50

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... Done

E: Unable to locate package build-essentials

How do I fix this problem?

1
  • 2
    you need to know about sudo aptitude search <insert_arg_here> Jun 26, 2011 at 20:37

8 Answers 8

97

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).

0
33

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
1
  • 1
    Is it normal for this process to take a long amount of time? Apr 17, 2020 at 19:44
20

Try

sudo apt-get update
sudo apt-get install build-essential

(If I recall correctly the package name is without the extra s at the end).

18

I know this has been answered, but I had the same question and this is what I needed to do to resolve it. During installation, I had not added a network mirror, so I had to add information about where a repo was on the internet. To do this, I ran:

sudo vi /etc/apt/sources.list

and added the following lines:

deb http://ftp.debian.org/debian wheezy main
deb-src http://ftp.debian.org/debian wheezy main

If you need to do this, you may need to replace "wheezy" with the version of debian you're running. Afterwards, run:

sudo apt-get update
sudo apt-get install build-essential

Hopefully this will help someone who had the same problem that I did.

0
7

The package is called build-essential without the plural "s". So

sudo apt-get install build-essential

should do what you want.

5

Try 'build-essential' instead.

0

To auto-generate the "source.list" file I suggest to use:

https://debgen.simplylinux.ch/

Where you can select the country, the distribution, ..etc After that, all you need to do is to replace (take a backup of the file first) your original source.list file with the generated one and do as mentioned in other answers:

sudo apt-get update
sudo apt-get install build-essential
0

Manifest for installing rust and build-essentials on ubuntu 20.04.03

rustup self uninstall
apt-get update
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
apt-get -u dist-upgrade
apt install aptitude 
sudo aptitude install libc6=2.31-0ubuntu9
sudo aptitude install build-essential
apt-get update
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
rustup toolchain install nightly --allow-downgrade --profile minimal --component clippy
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
rustc --version
source $HOME/.cargo/env

#No tested on me Fast Installation: Install all the required dependencies with a single command. (Be patient, this can take up to 30 minutes)

curl https://getsubstrate.io -sSf | bash -s -- --fast

Finally step test:

https://doc.rust-lang.org/cargo/getting-started/first-steps.html

#ArmanRiazi.Blockchain#Substrate#Dr.GavinWood

1
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 6, 2022 at 19:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.