Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using 'sudo apt-get install build-essentials'

Tags:

linux

g++

ubuntu

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?

like image 900
user785099 Avatar asked Jun 26 '11 20:06

user785099


People also ask

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

What is Python build-essential?

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.


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

like image 169
jncraton Avatar answered Oct 04 '22 00:10

jncraton


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 
like image 36
Magnus Avatar answered Oct 04 '22 01:10

Magnus