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:
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:
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:
Copy and paste the below script in your opened nano editor in the terminal:
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:
As we can see that there is no error and the file has been successfully compiled.
Run the C code to display the output:
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.
Discover more from Ubuntu-Server.com
Subscribe to get the latest posts sent to your email.