Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Aptitude Hold on package... Aptitude 'no solution'


    I seem to have a 'held' package or library that is causing me some headaches. I was hoping that someone might know how to help me get out from under it...so to speak. I tried a couple of apt-get commands that were suggested when others had the "Held package" statement. I would have to chase them down again, but them did nothing I could tell. The aptitude cli gives more detail, but the options do not allow me to use "dpkg-dev".

    I was going to build some package(s) and needed to install tools. Here is the apt-get command and results:

    Code:
    # apt-get install build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flex
    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:
     build-essential : Depends: g++ (>= 4:4.4.3) but it is not going to be installed
                       Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    # aptitude
    aptitude gives more of an explanation about what it wants to to do. This is kind of long, but someone may find it useful. However none of the options allow me to use the build tools

    Code:
    # aptitude install build-essential cmake libgmp3-dev libpcap-dev gengetopt byacc flex
    The following NEW packages will be installed:
      build-essential byacc cmake cmake-data{a} dpkg-dev{ab} fakeroot{a} flex g++{a} g++-4.8{ab} gengetopt libalgorithm-diff-perl{a} libalgorithm-diff-xs-perl{a} libalgorithm-merge-perl{a} libfakeroot{a} 
      libfl-dev{a} libgmp-dev{a} libgmp3-dev libgmpxx4ldbl{a} libpcap-dev libpcap0.8-dev{a} libsigsegv2{a} libstdc++-4.8-dev{ab} m4{a} 
    0 packages upgraded, 23 newly installed, 0 to remove and 3 not upgraded.
    Need to get 13.6 MB of archives. After unpacking 53.2 MB will be used.
    The following packages have unmet dependencies:
     libstdc++-4.8-dev : Depends: gcc-4.8-base (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14.04 is installed.
                         Depends: libgcc-4.8-dev (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14.04 is installed.
     dpkg-dev : Depends: libdpkg-perl (= 1.17.5ubuntu5) but 1.17.5ubuntu5.4 is installed.
     g++-4.8 : Depends: gcc-4.8-base (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14.04 is installed.
               Depends: gcc-4.8 (= 4.8.2-19ubuntu1) but 4.8.4-2ubuntu1~14.04 is installed.
    The following actions will resolve these dependencies:
    
         Keep the following packages at their current version:    
    1)     build-essential [Not Installed]                        
    2)     dpkg-dev [Not Installed]                               
    3)     g++ [Not Installed]                                    
    4)     g++-4.8 [Not Installed]                                
    5)     libstdc++-4.8-dev [Not Installed]                      
    
         Leave the following dependencies unresolved:             
    6)     dpkg-dev recommends build-essential                    
    7)     libgmp-dev recommends libstdc++-4.8-dev | libstdc++-dev
    
    
    Accept this solution? [Y/n/q/?] n
    The following actions will resolve these dependencies:
    
         Install the following packages:                      
    1)     gcc-4.7-base [4.7.3-12ubuntu1 (trusty)]            
    2)     libgcc-4.7-dev [4.7.3-12ubuntu1 (trusty)]          
    3)     libstdc++6-4.7-dev [4.7.3-12ubuntu1 (trusty)]      
    
         Keep the following packages at their current version:
    4)     build-essential [Not Installed]                    
    5)     dpkg-dev [Not Installed]                           
    6)     g++ [Not Installed]                                
    7)     g++-4.8 [Not Installed]                            
    8)     libstdc++-4.8-dev [Not Installed]                  
    
         Leave the following dependencies unresolved:         
    9)     dpkg-dev recommends build-essential                
    
    
    Accept this solution? [Y/n/q/?] n
    The following actions will resolve these dependencies:
    
         Install the following packages:                      
    1)     libc++-dev [1.0~svn199600-1 (trusty)]              
    2)     libc++-helpers [1.0~svn199600-1 (trusty)]          
    3)     libc++1 [1.0~svn199600-1 (trusty)]                 
    
         Keep the following packages at their current version:
    4)     build-essential [Not Installed]                    
    5)     dpkg-dev [Not Installed]                           
    6)     g++ [Not Installed]                                
    7)     g++-4.8 [Not Installed]                            
    8)     libstdc++-4.8-dev [Not Installed]                  
    
         Leave the following dependencies unresolved:         
    9)     dpkg-dev recommends build-essential                
    
    
    Accept this solution? [Y/n/q/?] n
    The following actions will resolve these dependencies:
    
          Install the following packages:                      
    1)      cpp-4.4 [4.4.7-8ubuntu1 (trusty)]                  
    2)      g++-4.4 [4.4.7-8ubuntu1 (trusty)]                  
    3)      gcc-4.4 [4.4.7-8ubuntu1 (trusty)]                  
    4)      gcc-4.4-base [4.4.7-8ubuntu1 (trusty)]             
    5)      libstdc++6-4.4-dev [4.4.7-8ubuntu1 (trusty)]       
    
          Keep the following packages at their current version:
    6)      build-essential [Not Installed]                    
    7)      dpkg-dev [Not Installed]                           
    8)      g++ [Not Installed]                                
    9)      g++-4.8 [Not Installed]                            
    10)     libstdc++-4.8-dev [Not Installed]                  
    
          Leave the following dependencies unresolved:         
    11)     dpkg-dev recommends build-essential
    I have attached a screen shot of aptitude full screen...

    Thanks for whatever you can suggest...

    Jack
    Attached Images Attached Images
    Last edited by jkwilborn; 12-04-2015 at 07:22 PM. Reason: left out a detail

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    14,038
    Install the unmet dependencies (cpp, g++, gcc, gcc-base, libstdc++-dev and dpkg-dev) first.

    You can also try installing build-essentials in Synaptic as it will happily deal with all of the gnarly dependencies for you, and install them in the proper order.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Rubberman, Thanks for the reply and assistance. Pasted the line back in without the 'build-essential' package and they installed properly, sort of. I did get an error, but it may be OK. Here is the part from the install of all but the 'build-essential' package...

    Code:
    Selecting previously unselected package cmake-data.
    Preparing to unpack .../cmake-data_2.8.12.2-0ubuntu3_all.deb ...
    ERROR: cmake-data is broken - called emacs-package-install as a new-style add-on, but has no compat file.
    Unpacking cmake-data (2.8.12.2-0ubuntu3) ...
    Selecting previously unselected package cmake.
    Preparing to unpack .../cmake_2.8.12.2-0ubuntu3_amd64.deb ...
    Unpacking cmake (2.8.12.2-0ubuntu3) ...
    Selecting previously unselected package gengetopt.
    When I try to do the install of the build-essential:

    Code:
    # apt-get install build-essential
    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:
     build-essential : Depends: g++ (>= 4:4.4.3) but it is not going to be installed
                       Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    #
    After installing Synaptic, the attempt to install dpkg-dev gives this error window:

    Code:
    dpkg-dev:
      Depends: libdpkg-perl (=1.17.5ubuntu5) but 1.17.5ubuntu5.4 is to be installed
     Recommends: build-essential but it is not going to be installed
     Recommends: fakeroot
     Recommends: libalgorithm-merge-perl but it is not going to be installed
    So am I reading this properly as libdpkg-perl is what's hosing this up? I wish I knew how I did this in the first place. That would help. As I never 'held' any packages that I know of directly.

    Thanks for your time..

    Jack

  4. $spacer_open
    $spacer_close
  5. #4
    It also didn't help to install synaptic, as it has the same error (previous reply). I tried to install another and this 'held' package is very annoying. Can I delete the 'held' package, if I can find it and see if it removes some of the problem? I did a '
    Code:
    dpkg --get-selections | grep hold
    ' in an attempt to identify the one, but it return nothing. If I change it to install, I get a bunch, so it doesn't think it's got any held packages?

    I needed to install an ssh server for remote access, but it won't let me install it because of the 'held' package...

    Any suggestions? Thanks to all who have looked to assist me in this problem.

    Jack
    Last edited by jkwilborn; 12-06-2015 at 12:26 AM. Reason: spelling

  6. #5
    Linux Enthusiast Steven_G's Avatar
    Join Date
    Jun 2012
    Location
    Western US
    Posts
    599
    Welcome to Dependency Hell; ain't it grand.

    It doesn't happen as often it used to, but when it does it's no fun. Unfortunately there is no clear cut, one size fits all solution. You just have to pick at it until you either fix it, build something else or give up.

    Some handy ones I've used:

    sudo aptitude install <packagename>
    sudo aptitude install -f <packagename>
    sudo apt-get install <packagename>
    sudo apt-get install -f <packagename>
    sudo apt-get upgrade
    sudo apt-get upgrade -f
    sudo apt-get dist-upgrade
    sudo apt-get dist-upgrade -f
    sudo aptitude upgrade
    sudo aptitude dist-upgrade
    sudo aptitude dist-upgrade -f
    sudo apt-get autoremove
    sudo apt-get clean
    sudo apt-get autoclean
    sudo dpkg --configure -a
    sudo aptitude purge <packagename>
    sudo apt-get purge <packagename>
    sudo apt-cache showpkg <packagename>
    sudo apt-get check
    sudo apt-get build-dep <packagename>
    sudo aptitude build-dep <packagename>
    dpkg -i <packagename>
    dpkg -p <packagename>

    You get the idea. Basically throw every dep resolution tool at it that you can think of.

    Try uninstalling the stuff that is throwing errors, or locking versions of stuff or holding stuff that is throwing errors and installing specific versions of packages.

    You're stuck dealing with circular logic and you have to figure out a way to break the circle so that you can get a hold of this thing from one end or the other.

    It's basically a logic puzzle.

    I got stuck one time wanting to switch from closed source java 7 to open JDK 7 for browser sec / update /dep reasons. But, b/c of the way the devs built things the only way to do it w/o breaking a bunch of stuff was to downgrade to open JDK 6 and then upgrade to open JDK 7.

    Hopefully this helps. Good luck.

  7. #6
    -->
    Steven_G,

    Thanks for the reply... Pat on the back to you, my friend, I just tried many options of dpkg, apt-get and synaptic that I found in man. Eventually aptitude gave me a solution that I liked, where there are downgrades, but no broken packages. I then had no problem installing ssh. It did have some dependency problems and I selected the option that didn't leave any unmet dependencies. I will pay more attention to what it's doing from now on. Learn something everyday, even though, I really didn't want to at this time..

    Again Thanks

    Jack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •