Installing build-essential package in Ubuntu is as simple as typing this command in the terminal:
sudo apt update && sudo apt install build-essential
But there are several questions around it that you may want answers to:
- What is build essential package?
- What does it contain?
- Why should you install it (if install at all)?
- How to install it?
- How to remove it?
What is build-essential package in Ubuntu?
The build-essential package actually belongs to Debian. It is not a piece of software in itself. It contains a list of packages that are required to create a Debian package (deb). These packages are libc, gcc, g++, make, dpkg-dev etc. The build-essential package contains those required packages as dependencies, so when you install build-essential, you install all those packages in one single command.
Please do NOT consider build-essential to be a super package that will magically install all kind of development tools from Ruby to Go for you in a single command. It has some development tool but not all.
Why would you want to install build-essential package?
It is used for creating DEB packages from the source code of an application. An average user does not go around creating DEB packages everyday, right?
However, some users may use their Ubuntu Linux system for software development. You want to run c program in Ubuntu, you need gcc compiler. You want to run C++ programs in Ubuntu, you need g++ compiler. If you have to use an unusual software that is only available from the source code, your system will throw make command not found error because you need to install make tool first.
All this can be installed individually, of course. However, it is much easier to take advantage of the build-essential package and install all these development tools at once. Thatโs the benefit you get.
It is like the ubuntu-restricted-extras package that allows you to install several media codecs at once.
Now that you know the advantage of this package, letโs see how to install it.
Installing build-essential package in Ubuntu Linux
Open a terminal in Ubuntu by pressing the Ctrl+Alt+T shortcut and enter the following command:
sudo apt update
With sudo command, youโll be asked to enter your accountโs password. When you type it, nothing is displayed on the screen. That is fine. Thatโs how it works in most Linux systems. Type your password blindly and press enter.
The apt update command refreshes the local package cache. This is essential for a fresh Ubuntu install.
After that, run the following command to install build-essential tool:
sudo apt install build-essential
It should show all the packages it is going to install. Press Y when asked for confirmation:
Wait a bit for the installation to complete. Thatโs it.
Removing build-essential tool from Ubuntu
Keeping those development tools wonโt harm your system. but if you are running low on the disk space, you may consider removing it.
Removing software is easy in Ubuntu thanks to the apt remove command:
sudo apt remove build-essential
It will be a good idea to run the autoremove command to remove the residual dependency packages as well:
sudo apt autoremove
You know all the essential about build-essential package now (pun intended). Enjoy it :)