Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am running this in ubuntu server installation:

sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386

but I am getting this:

Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version.
gnupg is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
 g++-multilib : Depends: cpp (>= 4:4.7.2-1ubuntu2) but it is not going to be installed
                Depends: gcc-multilib (>= 4:4.7.2-1ubuntu2) but it is not going to be installed
                Depends: g++ (>= 4:4.7.2-1ubuntu2) but it is not going to be installed
                Depends: g++-4.7-multilib (>= 4.7.2-1~) but it is not going to be installed

How can I fix this?

share|improve this question

marked as duplicate by Eliah Kagan, Seth, Eric Carvalho, Nathan Osman, Basharat Sial Apr 10 at 0:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

Try sudo apt-get build-dep build-essential

share|improve this answer
sudo apt-get install -f

This would install any dependencies that your previous installs missed. I just corrected my teamviewer and VNC installs.

share|improve this answer

Have you run: $ sudo aptitude update && sudo aptitude full-upgrade before?

share|improve this answer
No. But i was able to install 'sudo apt-get install git curl' – michael Nov 8 '12 at 21:58
Well, maybe you should. In principle, you should execute that (or an equivalent) short before installing any package to have your local package databases updated according to the info in the repositories. – Robert Vila Nov 8 '12 at 22:01
I have done 'sudo aptitude update && sudo aptitude full-upgrade' and they complete successfully. but when I still have the same error when I try to install build-essential – michael Nov 8 '12 at 22:23
Note. I am running a Ubuntu 'server' environment, instead of 'desktop' environment. Does that make a difference? – michael Nov 8 '12 at 22:25
I don't thin so. Are you sure the names with the colon are ok? Why don't you execute: $ aptitude show package:i386 substituting "package" with the package names you have with a colon? – Robert Vila Nov 9 '12 at 0:47
show 1 more comment

There is a conflict on dependencies for the package build-essential regarding g++ and relating to installation of g++-multilib just as apt is telling you. i.e.the two packages being installed depend on different builds of same package g++

To clean out apt of all unnecessary and unused packages

sudo apt-get update 
sudo apt-get upgrade
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get clean

To hunt down existing broken dependencies

sudo apt-get check
sudo apt-get check build-essential

If no errors are given

sudo apt-get install g++ gcc build-essential

then if that goes well go for installing g++multilib

share|improve this answer

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