Prerequisites
Te able to add new repositories and install packages on your Ubuntu system, you must be logged in as root or user with Sudo privileges.
Installing GCC on Ubuntu
The default Ubuntu repositories contain a meta-package named build-essential
that contains the GCC compiler and a lot of libraries and other utilities required for compiling software.
Perform the steps below to install the GCC Compiler in any version of Ubuntu:
- Start by updating the packages list:
$ sudo apt update
- Install the
build-essential
package by typing:
$ sudo apt install build-essential
The command installs a bunch of new packages including gcc
, g++
and make
.
You may also want to install the manual pages about using GNU/Linux for development:
$ sudo apt-get install manpages-dev
- To validate that the GCC compiler is successfully installed, use the
gcc --version
a command which prints the GCC version:
This 2 commands are same:
$ gcc --version
$ gcc -v
That’s it. GCC is now installed on your system, and you can start using it.
Lascia un commento