How To Install build-essential on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 479 words
Introduction
In this tutorial we learn how to install build-essential
on Ubuntu.
What is build-essential
build-essential is:
If you do not plan to build Debian packages, you don’t need this package. Starting with dpkg (>= 1.14.18) this package is required for building Debian packages.
This package contains an informational list of packages which are considered essential for building Debian packages. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed.
If you have this package installed, you only need to install whatever a package specifies as its build-time dependencies to build the package. Conversely, if you are determining what your package needs to build-depend on, you can always leave out the packages this package depends on.
This package is NOT the definition of what packages are build-essential; the real definition is in the Debian Policy Manual. This package contains merely an informational list, which is all most people need. However, if this package and the manual disagree, the manual is correct.
There are three methods to install build-essential
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install build-essential Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install build-essential
using apt-get
by running the following command:
sudo apt-get -y install build-essential
Install build-essential Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install build-essential
using apt
by running the following command:
sudo apt -y install build-essential
Install build-essential Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install build-essential
using aptitude
by running the following command:
sudo aptitude -y install build-essential
How To Uninstall build-essential on Ubuntu
To uninstall only the build-essential
package we can use the following command:
sudo apt-get remove build-essential
Uninstall build-essential And Its Dependencies
To uninstall build-essential
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove build-essential
Remove build-essential Configurations and Data
To remove build-essential
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge build-essential
Remove build-essential configuration, data, and all of its dependencies
We can use the following command to remove build-essential
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge build-essential
Dependencies
build-essential have the following dependencies:
References
Summary
In this tutorial we learn how to install build-essential
package on Ubuntu using different package management tools: apt, apt-get and aptitude.