Categories: Ubuntu

How to Install and Use Build Essential Tools on Ubuntu 22.04

Before proceeding towards installing and using the build-essential tools, we will first understand what they are and how they help us? This is the package available in Ubuntu that contains the dependencies of other packages, especially the Debian packages and the compilers for different programming languages.

This write-up will help you understand the installation procedure of Build essentials on Ubuntu with the example of its usage.

How to install and use Build Essential Tools on Ubuntu?

For the installation of the build-essential tools package from the official repository of Ubuntu, execute the mentioned-below command:

$
Sponsored
sudo apt install build-essential -y

Well, as it has been discussed in the above section that the package of build-essential contains different compilers so to validate this statement, we will check the installed version of the GCC compiler that is included in the build essentials tools and is used to compile the code of C programming language:

$ gcc –version

In the above output, the version “11.2.0” of GCC is confirming that it has been installed, with the installed packages of Build Essentials.

To confirm the working of the compiler, we will write a simple C program to display the “Welcome to the LinuxHint” message. So, we will create a file with the name of “MyCfile” with the nano text editor:

$ nano MyCfile.c

Copy and paste the below script in your opened nano editor in the terminal:

int main() {

printf(“Welcome to the LinuxHint!n);

return 0;

Sponsored

}

Once pasted, save the file using the “CTRL+S” shortcut key and exit from the nano editor using “CTRL+X”.

Now, compile the file with the gcc compiler and save it in a new file using the command:

$ gcc MyCfile.c -o MyCfile

As we can see that there is no error and the file has been successfully compiled.

Run the C code to display the output:

$ ./MyCfile

The displayed message confirmed that the GCC compiler installed using build essential tools is working perfectly.

Conclusion

Execute the “sudo apt install build-essential” command and it will install all the necessary packages to install build-essential tools on Ubuntu 22.04. Build essential tools contain the dependencies tools of different packages and compilers. In this blog, we have explained the installation method of Build Essential tools and its usage on Ubuntu using the command line interface.

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

24 hours ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

2 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

2 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

3 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

3 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

4 days ago