Using 'sudo apt-get install build-essentials'

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

8 Answers

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

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

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

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 wheezy main deb-src 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

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

sudo apt-get install build-essential 

should do what you want.

Try 'build-essential' instead.

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

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 

Manifest for installing rust and build-essentials on ubuntu 20.04.03

rustup self uninstall apt-get update sudo add-apt-repository "deb $(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 | 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 -sSf | bash -s -- --fast 

Finally step test:

#ArmanRiazi.Blockchain#Substrate#Dr.GavinWood

1

You Might Also Like