I was trying to use sudo apt-get install build-essentials
to install the g++ compiler on my Ubuntu Linux box. But it gave me the following message:
Reading package lists... Done
Building dependency tree
Reading state information... DoneE: Unable to locate package build-essentials
How do I fix this problem?
You may also need to run sudo apt-get update to make sure that your package index is up to date. For anyone wondering why this package may be needed as part of another install, it contains the essential tools for building most other packages from source (C/C++ compiler, libc, and make).
build-essential is a metapackage (a package that installs many other packages, like g++ and gcc: the GNU C & C++ compilers). It's required if you want to compile anything from source, and if you want to work with almost any programming language.
Drop the 's' off of the package name.
You want sudo apt-get install build-essential
You may also need to run sudo apt-get update
to make sure that your package index is up to date.
For anyone wondering why this package may be needed as part of another install, it contains the essential tools for building most other packages from source (C/C++ compiler, libc, and make).
In my case, simply "dropping the s" was not the problem (although it is of course a step in the right direction to use the correct package name).
I had to first update the package manager indexes like this:
sudo apt-get update
Then after that the installation worked fine:
sudo apt-get install build-essential
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With