Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I do know there are questions like mine, but I couldn't get it work reading their answers. I'm trying to install build-essentials, but the package is broken, therefore I can't install the needed compiler.

The following packages have unmet dependencies:   build-essential:
Depends: libc6-dev but it is not going to be installed or libc-dev
Depends: g++ (>= 4:4.3.1) but it is not going to be installed E: Broken packages

What I tried so far:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential -f

None of the above worked. I suppose the problem is in my sources.list, here is it:

deb http://archive.ubuntu.com/ubuntu/ lucid main restricted universe 
deb-src http://archive.ubuntu.com/ubuntu/ lucid main restricted universe

How can I fix it? Thanks in advance!

share|improve this question
add comment

3 Answers 3

sudo apt-get install gcc

sudo apt-get install g++

sudo apt-get install libc6-dev

sudo apt-get install build-essential
share|improve this answer
    
The following packages have unmet dependencies: g++: Depends: gcc (>= 4:4.4.3-1ubuntu1) but it is not going to be installed Depends: g++-4.4 (>= 4.4.3-1) but it is not going to be installed Depends: gcc-4.4 (>= 4.4.3-1) but it is not going to be installed E: Broken packages –  maikati Apr 19 '13 at 13:44
    
Updated the answer with command to install gcc –  thefourtheye Apr 19 '13 at 13:46
    
The following information may help to resolve the situation: The following packages have unmet dependencies: gcc: Depends: gcc-4.4 (>= 4.4.3-1) but it is not going to be installed Recommends: libc6-dev but it is not going to be installed or libc-dev E: Broken packages –  maikati Apr 19 '13 at 14:13
    
Did you try to install gcc? –  thefourtheye Apr 19 '13 at 14:15
    
Yeah, I tried to install gcc. –  maikati Apr 19 '13 at 15:47
show 1 more comment

I fixed it. Anyway, if someone needs the answer, the problem was in my sources.list. I just changed it then

sudo apt-get update

and the package was downloaded and installed successfully.

share|improve this answer
add comment

Try to use aptitude instead of apt-get. In my case it gave me a solution to fix dependencies automatically.

share|improve this answer
add comment

Your Answer

 
discard

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.