LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   g++ fails to install (http://www.linuxquestions.org/questions/ubuntu-63/g-fails-to-install-4175445378/)

bharat_iyengar 01-13-2013 05:43 AM

g++ fails to install
 
I am running Ubuntu 12.04LTS from virtualbox. While installing a package, configure gave an error saying
Code:

configure: error: C++ compiler cannot create executables
So I tried installing g++ by sudo apt-get install g++ but the installation failed with this statement: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

When I try to install build-essentials it returns an error:

Code:

The following packages have unmet dependencies:
build-essential : Depends: g++ (>= 4:4.4.3) but it is not installable
E: Unable to correct problems, you have held broken packages.

Done with all troubleshooting steps that i can find to solve this irritating error:
Quote:

Unable to correct problems, you have held broken packages
i had done, as root, the following:

Code:

dpkg --configure -a
apt-get install -f
apt-get install --fix-broken
apt-get clean && apt-get update

Still same error when i try to install g++

I am not able to install aptitude either. [somebody suggested that using aptitude might solve the problem]

johnsfine 01-13-2013 08:39 AM

Quote:

Originally Posted by bharat_iyengar (Post 4868865)
I am running Ubuntu 12.04LTS from virtualbox. While installing a package, configure gave an error saying
Code:

configure: error: C++ compiler cannot create executables

Don't try to install packages that way. Use the package manager in Ubuntu.

Quote:

So I tried installing g++ by sudo apt-get install g++
That is correct.

Quote:

but the installation failed with this statement: E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
That is outside my expertise, but that is the problem for which you should seek help from some Ubuntu experts. That method of installing g++ was correct and trying other things because that didn't work is wrong. Focus on solving that issue.

There is a GUI package manager you can use instead of apt-get. You might want to try that to see if it gives you a better understanding of the "held packages" issue. I don't recall the name of the GUI package manager that is installed by default in Ubuntu 12.04LTS

Snark1994 01-13-2013 08:46 AM

Quote:

Originally Posted by johnsfine (Post 4868931)
I don't recall the name of the GUI package manager that is installed by default in Ubuntu 12.04LTS

I think it's "Ubuntu Software Centre".


All times are GMT -5. The time now is 12:45 PM.