user785099
user785099

Reputation: 5553

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?

Upvotes: 51

Views: 158734

Answers (8)

Arman Riazi
Arman Riazi

Reputation: 53

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

Upvotes: 0

jncraton
jncraton

Reputation: 9132

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

Upvotes: 102

Mohanad Kaleia
Mohanad Kaleia

Reputation: 791

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

Upvotes: 0

William Everett
William Everett

Reputation: 781

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.

Upvotes: 18

Magnus
Magnus

Reputation: 11396

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

Upvotes: 34

Paul
Paul

Reputation: 756

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

sudo apt-get install build-essential

should do what you want.

Upvotes: 7

fyr
fyr

Reputation: 20859

Try 'build-essential' instead.

Upvotes: 5

ChristopheD
ChristopheD

Reputation: 116147

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

Upvotes: 20

Related Questions