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 thought apt-get was a package manager that installs all dependencies by default when it installs an application. But when I tried installing gcc-4.7, I get this:

 sudo apt-get install gcc-4.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gcc-4.7 : Depends: cpp-4.7 (= 4.7.3-2ubuntu1~12.04) but it is not going to be installed
           Depends: libgcc-4.7-dev (= 4.7.3-2ubuntu1~12.04) but it is not going to be installed
 libstdc++6-4.7-dev : Depends: libgcc-4.7-dev (= 4.7.3-2ubuntu1~12.04) but it is not going to be installed

Why didnt it install the "unmet dependencies"?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There is a possibility that if they were installed they would conflict with something else. Or, maybe something is messed up in your software configuration. What I would do first is use the apt-get -f install command like the prompt tells you to, and then try installing again.

If that doesn't work try using aptitude to install gcc. Aptitude usually is able to fix problems automatically when apt-get can't. (As you have just found out) Just install it using:

# apt-get install aptitude

And then just use it like you would use apt-get:

# aptitude install gcc-4.7

You may also want to use aptitude to update your packages and upgrade if the previous command doesn't work:

# aptitude update
# aptitude upgrade
share|improve this answer

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.