≡ Menu

Ubuntu Linux Install GNU GCC Compiler and Development Environment

How do I install GNU/GCC (C and C++) compiler and related tools (such as make, debugger, man pages) collection under Ubuntu Linux operating system using command line options?

You need to install following packages on Debian and Ubuntu Linux:
build-essential package – Installs the following collection to compile c/c++ program on a Ubuntu Linux including:

  1. libc6-dev – C standard library.
  2. gcc – C compiler.
  3. g++ – C++ compiler.
  4. make – GNU make utility to maintain groups of programs.
  5. dpkg-dev – Debian package development tools.

Basically, build-essential package contains an informational list of packages which are considered essential for building Ubuntu packages including gcc compiler, make and other required tools. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed. In this tutorial, you will learn about installing the GNU C compiler and GNU C++ compiler on a Ubuntu Linux.

Installing compilers using apt command

Open the terminal app and type the following apt command/apt-get command:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install build-essential

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential

Sample outputs:

Fig.01: How do I install development tools for Ubuntu Linux?

Fig.01: How do I install development tools for Ubuntu Linux?

Verify installation

Type the following command:
$ whereis gcc make
$ gcc --version
$ make -v

Fig.02: Finding out installed make and gcc version

Fig.02: Finding out installed make and gcc version

Installing the dev man pages on a Ubuntu Linux

Type the following command:
$ sudo apt-get install manpages-dev man-db manpages-posix-dev
To view library calls (functions within program libraries), enter:
$ man 3 scanf
$ man 2 execve
$ man 2 fork

Installing the X11 development compilers

Type the following command:
$ sudo apt install libx11-dev

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:

{ 0 comments… add one }

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: ,