Open In App

How to Install GCC Compiler on Linux?

Last Updated : 06 Oct, 2021
Like Article

In this article, we will discuss how to install a GCC compiler on Linux

GCC stands for GNU Compiler Collections which is used to compile mainly C and C++ language. It can also be used to compile Objective C and Objective C++. The GCC is an open-source collection of compilers and libraries.

Let’s start with the steps to install the GCC on Linux.

To install the GCC open the terminal on Linux.

The terminal takes the input from the user in the form of commands and displays the output on the screen. Hence we have to pass some commands to install the GCC.

Follow the commands step by step to install the GCC.

Command 1: The very first step is to update the packages. This command is used to download package information from all configured sources and to get the info of the updated versions of the packages.

sudo apt-get update
get updates first


Note: In the first command it will ask for your password, make sure to enter the password correctly.

Command 2: Now we have to install the build-essential packages, which is also known as a meta-package, it contains the GCC compiler all the other essentials used to compile the software written in C and C++ language.

sudo apt install build-essential
build the dependencies


It will take some time to install all the essential packages.

Command 3: After the second command it will install GCC on your Linux, to verify it is installed correctly, check the version of the GCC.

gcc --version
check gcc version


Now, we have successfully installed the GCC on Linux.

Note: Versions may vary from time to time.

Similar Reads

How to Install Protobuf Compiler in MacOS?
Protocol Buffers (Protobuf) is a language-neutral, platform-neutral extensible mechanism for serializing structured data so that it can be transmitted over a wire or stored in files and it was developed by Google in 2008. They are faster than JSON and XML because they transfer data in binary format which improves the speed of transmission and takes
2 min read
How to Install GD module on Linux?
GD is a python library. It provides various features and an async-ready API wrapper for the geometry dash. It is easy to use. It is used to implement the geometry dash API and is also very handy to work with object-oriented design. Installing GD module on Linux Method 1: Using pip to install GD Package Follow the below steps to install the GD packa
2 min read
How to Install Kali Linux on Windows?
Kali Linux is an open-source Linux distribution based on Debian, designed for sophisticated penetration testing and security auditing. Kali Linux includes hundreds of tools for diverse information security activities such as penetration testing, security research, computer forensics, and reverse engineering. This multi-platform solution is accessib
2 min read
How to install and configure Docker on Arch-based Linux Distributions(Manjaro) ?
In this article, we are going to see how to install and configure Docker on Arch-based Linux Distributions. Docker is an open-source containerization platform used for building, running, and managing applications in an isolated environment. A container is isolated from another and bundles its software, libraries, and configuration files. Containers
2 min read
Install Pytorch on Linux
In this article, we are going to see how you can install PyTorch in the Linux system. We are using Ubuntu 20 LTS you can use any other one. To successfully install PyTorch in your Linux system, follow the below procedure: First, check if you are using python’s latest version or not. Because PyGame requires python 3.7 or a higher version, make sure
2 min read
How to Install and Use Htop on Linux?
For Linux systems, Htop is an interactive system control, process viewer, and process manager. It was created as a replacement for the Linux program top, and it has a lot of the same features as the top, but with a lot more flexibility in terms of how system processes can be interpreted. Unlike top, htop displays the entire list of running processe
2 min read
How to Install Deepin on Linux?
Deepin is the top Linux distribution from China, it provides a beautiful, easy-to-use, safe, and reliable operating system for global users. Deepin is based on Debian's stable branch. The feature that sets Deepin aside from the rest of Linux distributions is its desktop environment known as DDE Deepin Desktop Environment, which was described as "th
3 min read
How to Install NuGet from Command Line on Linux?
NuGet is the package manager for the .NET framework. It's very much useful for developers as developers can create, publish and consume packages. The package format of NuGet consists of a single ZIP file with the extension of .nupkg and which is the DLL compiled code like the package’s version number. A NuGet package manager is a cross-platformed m
2 min read
How to Install Git on Windows Subsystem for Linux?
Git is an open-source distributed version control system developed to handle everything from simple to complex projects with performance and speed. Git software allows a team or group of developers to work together, with all using the same files and folders. It gradually reduces the confusion that tends to happen when multiple people are editing th
2 min read
How to Install Linux on Windows PowerShell Subsystem?
There are several ways to Install a Linux subsystem on your Windows PC Powershell Environment. It is good for learners, but it is recommended using original Linux OS if you are a developer as the Subsystem lacks the pre-installed Linux tools. Before we begin installing a Linux subsystem, we need to first enable a Windows feature for Subsystems. Ena
2 min read