Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 15090  / 1 Year ago, tue, april 18, 2023, 11:37:45

When I try to install g++ in my machine I am getting the following message.



support:/$ sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
g++ : Depends: gcc (>= 4:4.8.1-2ubuntu3) but it is not going to be installed
Depends: g++-4.8 (>= 4.8.1-4~) but it is not going to be installed
Depends: gcc-4.8 (>= 4.8.1-4~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


I am using Ubuntu 13.10(Saucy). I have stuck up with this problem for 2 days now. I know this is a duplicate question but still I am posting it because I couldn't find an solution from other similar posts.



I have tried all solutions given in Package system is broken. How to fix it? . But it couldn't solve the issue.



As asked in a comment in https://askubuntu.com/questions/385008/cant-install-g-on-13-10-dependency-problem , Im putting the result of apt-cache policy g++ g++-4.8 below



g++:
Installed: (none)
Candidate: 4:4.8.1-2ubuntu3
Version table:
4:4.8.1-2ubuntu3 0
500 http://de.archive.ubuntu.com/ubuntu/ saucy/main i386 Packages
g++-4.8:
Installed: (none)
Candidate: 4.8.2-1ubuntu1
Version table:
4.8.2-1ubuntu1 0
500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/ saucy/main i386 Packages
4.8.1-10ubuntu8 0
500 http://de.archive.ubuntu.com/ubuntu/ saucy/main i386 Packages


PS: I am not looking for any particular version of g++. Actual working scenario is I want to install npm package 'libxmljs' which is dependent on 'node-gyp'. For 'node-gyp' to install properly the system should have 'make', 'g++' and 'python'. I have make and python in my system. The following is what I get when I run g++ --version



The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>


Please help me to solve the issue.


More From » apt

 Answers
1

A detailed solution about how to solve broken package issue can be found here How do I resolve unmet dependencies after adding a PPA?



If you couldn't solve the broken package issue using the solutions in the above link then you can use 'aptitude' instead of 'apt'. Please using the following commands to solve the issue.



sudo apt-get install aptitude

sudo aptitude install build-essential

[#27967] Tuesday, April 18, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stantildlike

Total Points: 363
Total Questions: 135
Total Answers: 120

Location: Pitcairn Islands
Member since Fri, Dec 17, 2021
2 Years ago
;