Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1031  / 1 Year ago, sun, march 12, 2023, 1:02:29

I'm trying to install build-essential using sudo apt-get install build-essential like I'm supposed to. It returns with the error



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


I have tried to use a few different fixes, like sudo apt-get install -f and sudo apt-get update as well as sudo apt-get upgrade but none have fixed the packages. When using sudo apt-get install -f this is what terminal tells me.



    Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-image-3.19.0-25-generic linux-image-extra-3.19.0-25-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.


Other options return nothing.
I looked up a few other guides and questions, but none worked. I tried dpkg -i to try and let it install the dependencies for me, I tried following the labrynth myself and installing the dependencies by hand, but I just got more and more dependencies until I couldn't find the light at the end of the cold tunnel of dependencies. Is there an easy way to install build-essential through terminal that I'm not using, or is there a command that can install this long list of dependencies for me? I think I've included all the information that you'll need. This is a link to the dpkg -i guide that I tried-- How to let `dpkg -i` install dependencies for me? If there is additional information needed I can get it to you!



EDIT:



Here is the output of apt-cache policy build-essential g++.



    build-essential:
Installed: (none)
Candidate: 11.6ubuntu6
Version table:
11.6ubuntu6 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
g++:
Installed: (none)
Candidate: 4:4.8.2-1ubuntu6
Version table:
4:4.8.2-1ubuntu6 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages


I also ran someone else's solution and it didn't work, but I noticed something interesting in the code so I ran sudo apt-get dist-upgrade a second time to get the information on its own. Here's what I got. I'm not sure what it means or how to fix it. If anyone can answer any of the multiple questions here that'd be very helpful! Thank you!



    $ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
cpp-4.8 gcc-4.8-base gcc-4.8-base:i386 libasan0
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.


I tried to run sudo apt-get updates and sudo apt-get install -f after I saw this, but I just got the same output as before.


More From » 14.04

 Answers
5

This may be a situation specific fix (I've never had this happen twice so I don't know) but when I ran sudo apt-get install build-essential checkinstall it installed all dependencies. Another way to install dependencies may be through gdebi (not sure on that one either. I've never used it, but after some research I believe it would work). I've tried installing other packages using sudo apt-get install package checkinstall and it's never asked me to fix dependencies again.


[#14628] Sunday, March 12, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cisccla

Total Points: 66
Total Questions: 134
Total Answers: 115

Location: Croatia
Member since Fri, Sep 11, 2020
4 Years ago
;