Janna Theme License is not validated, go to the theme options page to validate the license, you need a single license for each domain name.

How to install GCC on Ubuntu

GCC is one of the preferred tools used by developers working on the Linux platform. It serves as an integration for many compilers for popular programming languages like Java, C, C++, Fortran, and many more. If you are starting your Linux journey, what better choice than Ubuntu? Ubuntu is the most popular Linux distribution out there. It is known for being easy to learn without compromising on features. So, if you need to know how to install GCC on your Ubuntu system, this article is the perfect place to start. We will explore how to download and install GCC on Ubuntu in the sections below. But before that, let’s learn more about GCC.

How-to-Install-GCC-on-Ubuntu-1024x683-1

How to install GCC on Ubuntu

GCC (GNU Compiler Collection) is a set of tools for compiling source code from various programming languages into binaries, executable files, or libraries. GCC is a command-line compiler that can be installed on Ubuntu.

  • Included GCC Translator , as well as many other libraries and tools needed to create applications, In the default Ubuntu repository as a build base.
  • GCC support Programming languages C, C++, Java, Objective-C, Go, Fortran, and Ada And more.
  • Many open source projects, including: GNU and Linux kernel tools, from GCC Create your code.

This tutorial will show you how to set up the GCC compiler on Ubuntu 18.04. We'll teach you how to install the stable version of the distribution as well as the latest version of GCC. The steps are the same for Ubuntu 16.04 and any Ubuntu-based distribution, such as Kubuntu, Linux Mint, and Elementary OS.

Also read:  Top 4 Ways to Stop Instagram From Automatically Following Accounts

Note: You must be logged in as root or a user with sudo privileges to create new repositories and install packages on your Ubuntu system.

Method 1: Through Ubuntu Terminal

To set up GCC on Ubuntu, you'll need to download and install the build-basic package. Open a terminal window to download gcc for Ubuntu. Follow the steps below to install GCC on Ubuntu via Terminal.

Option 1: Install GCC version a certain

1. Press Ctrl + Alt + T keys Together to run Terminal window on the desktop.

Note: Alternatively, go to the Applications list and search for Terminal.

Ubuntu-linux-terminal How to install GCC on Ubuntu

2. Use the installation command below to install. build-basic package on Ubuntu Once the terminal window opens.

sudo apt install build-essential

Note: The sudo command prompts you for your password. Users can use this command to run a single task as root.

ubuntu-linux-terminal-command-to-install-build-essential-package How to install GCC on Ubuntu

3. Ubuntu will ask you for your password. Enter it. Your user password to follow.

4. The terminal prompt will gather all dependencies for the build-basic package once you provide the password. Ubuntu will then ask you whether you want to install the package. To continue, press Y keyWhen you click on Y key , will start Ubuntu Install GCC on your device.

5. This procedure should not take more than a few minutes. Using man gcc command You can browse the GCC documentation after the procedure is complete.

Option 2: Install multiple versions of GCC

While most Ubuntu users will be satisfied with the base build package because it contains GCC 10, it isn't the only version of GCC available. Support for additional languages, improved performance, and expanded functionality have been included in newer versions of the GCC compiler. You have the option to install different versions of GCC on Ubuntu. Here's how to download gcc for Ubuntu.

Also read:  How to Find My WhatsApp Number and Username on Android and iOS

1. First, on your Ubuntu desktop, open Terminal window.

2. Once opened, use Next command To search the Ubuntu software repositories for available GCC packages:

apt search gcc

7 How to Install GCC on Ubuntu

3. Search the claim for GCC version which you want to install on Ubuntu. It will be available GCC 7, GCC 8, 9, and 10 for installation.

4. Install GCC using the appropriate installation instructions below once you have found the version you want to install on your Ubuntu computer. gcc-7 و gcc-8 و gcc-9 و gcc-10 These are GCC packages.

5. To install GCC 7 version On Ubuntu.

sudo apt install gcc-7 g++-7

execute-command-to-install-gcc-version-7-in-ubuntu-linux-terminal How to install GCC on Ubuntu

6. To install GCC 8 version On Ubuntu.

sudo apt install gcc-8 g++-8

execute-command-to-install-gcc-version-8-in-ubuntu-linux-terminal How to install GCC on Ubuntu

7. To install GCC 9 version On Ubuntu.

sudo apt install gcc-9 g++-9

execute-command-to-install-gcc-version-9-in-ubuntu-linux-terminal How to install GCC on Ubuntu

8. While installing the build-basic package is highly recommended for running GCC 10 on Ubuntu, it is not the only option. Installing the gcc-10 and g++-10 packages will install GCC 10.

sudo apt install gcc-10 g++-10 

execute-command-to-install-gcc-version-10-in-ubuntu-linux-terminal How to install GCC on Ubuntu

The second method: Through the Synaptic Package Manager

If you don't want to use the console to install GCC on Ubuntu, you can use Synaptic Package Manager Alternatively to download GCC in ubuntu.

Option 1: Install a specific GCC version

Follow these steps to install GCC through Synaptic Package Manager.

1. To begin, make sure you: Install Synaptic. To get Synaptic , Go to Ubuntu Software and search for Synaptic , then install it.

install-synaptic-package-manager-from-ubuntu-software-1024x216-1 How to install GCC on Ubuntu

2. Open Synaptic Package Manager By searching for it in the application list once it is installed.

Also read:  How to Change Your Outlook Password on Mobile, Desktop, and Web

open-synaptic-package-manager-from-the-all-applications-menu-ubuntu-linux-768x395-1 How to install GCC on Ubuntu

3. Then, in the upper right corner of the screen, find the button. Search.

4. To view search results, select the button. Synaptic Search And type build-basic followed byEnter key.

How to install GCC on Ubuntu

5. Search the cross-search results for build-essential.

6. Once selected, right-click on it and choose the option Designate for Installation To distinguish the package build-essential لInstall Synaptic.

How to install GCC on Ubuntu right-click on build essential and select Mark for installation in Snaptic Package Manager Ubuntu Linux 768x462-1

7. In Synaptic, locate the button "Application" Click it to start. Installing GCC on Ubuntu.

How to install GCC on Ubuntu

Option 2: Install multiple versions of GCC

To install a GCC version other than the one included with the build-basic package on Ubuntu, perform the steps below.

1. First, open the package manager. Synaptic Package Manager.

2. Once Open Synaptic , click the . button search.

3. Then select one of the products from the list below and enter it in the search box.

  • GCC7: gcc-7, g++-7
  • GCC8: gcc-8, g++-8

And also

  • GCC9: gcc-9, g++-9 
  • GCC10: gcc-10, g++-10

4. To install the GCC package(s) you found in Synaptic, right-click on them and choose the button "application".

How to install GCC on Ubuntu

5. Repeat this procedure as needed to install as many GCC versions as you want on Ubuntu.

Frequently asked questions (FAQs)

Q1. Is GCC already installed on your Ubuntu?

answer. The GCC package is installed by default in all Ubuntu desktop variants.

Q2. What command is used to install GCC?

answer. Install GNI C/C++ (GCC) and the required libs using the up2date command, the yum command, or the apt-get command, depending on your Linux distribution.

Q3. What is the purpose of Ubuntu?

answer. Ubuntu has everything you need to run your company, school, home, or business. All major software, such as office suites, browsers, email, and media applications, are preinstalled, and the Ubuntu Software Center contains hundreds of additional games and applications.

We hope this article was helpful in learning how to install GCC on Ubuntu. You can find more technology-related articles on our website. If you have any suggestions or comments regarding this article, please contact us in the comments section below.

Go to top button