Low Orbit Flux Logo 2 D

How to Install GCC (build-essential) on Ubuntu

If you want to install GCC on your system and want to be able to compile things you are going to need to install the build-essentials package. On Ubuntu this includes all of the normal build tools that you would expect including gcc, g++, and make.

Just run these commands to update your repo info and install GCC and other build tools:


sudo apt update
sudo apt install build-essential

That’s it! You’re done!

Test It

Create a basic hello world program in C like this:


hello.c

#include <stdio.h>
int main()
{
   printf("Hello, LinuxTect!");
   return 0;
}

Build it with GCC:


gcc -o hello hello.c

Execute it:


./hello