How to install and use Build Essential Tools on Ubuntu 22.04

Before proceeding to install and use 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, specifically the Debian packages and the compilers for various programming languages.

This article will help you understand the process of installing Build essentials on Ubuntu with a use case.

How do I install and use Build Essential Tools on Ubuntu?

To install build-essential tools package from Ubuntu official repository, run below mentioned command:

$ sudo suitable To install build essential -y

Now that the above section discussed that build-essential’s package contains various compilers, to confirm this statement, let’s check the installed version of the GCC compiler that comes with the build-essentials tools and is used to compile the C programming language code:

$ gcc –Execution

In the above output is the version “11.2.0” from GCC confirmed that it was installed, with the packages installed by build foundations.

To confirm the compiler’s function, let’s write a simple one C Program to display the “Welcome to the Linux Hint” message. So let’s create a file called “MyCfile” with the nano Text editor:

$ nano MyCfile.c

Copy and paste the following script into your open Nano editor in Terminal:

#include

internal mainly() {

pressure(“Welcome to LinuxHint!n);

return 0;

}

After inserting the file, save it with the key combination “CTRL+S” and exit the nano editor with “CTRL+X”.

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

$ gcc MyCfile.c -O MyCfile

As we can see, there is no error and the file was successfully compiled.

Run the C code to see the output:

$ ./MyCfile

The message displayed confirmed that the GCC compiler installed with Build Essential Tools is working properly.

Conclusion

Run the command “sudo apt install build-essential” and it will install all the necessary packages to install build-essential tools on Ubuntu 22.04. Build Essential Tools contain the dependency tools of various packages and compilers. In this blog, we have explained the Build Essential tools installation method and how to use it on Ubuntu with command line interface.

Related Posts