Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

apt-get install build-essential fails with the following errors:

~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'build-essential' has no installation candidate

I had just run sudo apt-get update before trying this install.

The folder /etc/apt/sources.list.d is empty. Here's the meat of /etc/apt/sources.list:

$ grep deb\ http: /etc/apt/sources.list  #(with "deb http://" deleted) raring main restricted raring-updates main restricted raring universe raring-updates universe raring multiverse raring-updates multiverse raring-backports main restricted universe multiverse raring-security main restricted raring-security universe raring-security multiverse raring main  

This with ubuntu 13.04 64 bit.

apt-cache policy build-essential 
 Installed: (none)
 Candidate: (none)
 Version table: 

The directory /etc/apt/sources.list.d is empty.

share|improve this question
Welcome to Ask Ubuntu! Could you include the output of apt-cache policy build-essential in your question? Also include the output of grep -r ^deb\ /etc/apt/sources.list.d /etc/apt/sources.list to list all your sources.. – gertvdijk Jul 3 '13 at 23:54
up vote 3 down vote accepted

Problem solved. In Ubuntu Software Center >> Edit >> Software Sources, I changed the server to Main Server and then run sudo apt-get update. Then sudo apt-get install build-essential which worked.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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