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?
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
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.
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).
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
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.
Source: Stackoverflow.com