I'm running apt-get install aptitude but it gives me this error:‌

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:
 aptitude : Depends: libcwidget3 but it is not going to be installed
            Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04 is to be installed
            Depends: libxapian22 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

What is wrong ?

Here is some additional information:

$ uname -a
Linux ubuntu 3.19.0-47-generic #53~14.04.1-Ubuntu SMP Mon Jan 18 16:09:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -r
Release:    15.04

$ apt-cache policy aptitude libcwidget3 libstdc++6 libxapian22
 aptitude:
  Installed: (none)
  Candidate: 0.6.11-1ubuntu3
  Version table:
     0.6.11-1ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
     0.6.8.2-1ubuntu4 0
        100 /var/lib/dpkg/status
libcwidget3:
  Installed: (none)
  Candidate: 0.5.17-2ubuntu1
  Version table:
     0.5.17-2ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
     0.5.16-3.5ubuntu1 0
        100 /var/lib/dpkg/status
libstdc++6:
  Installed: 4.8.4-2ubuntu1~14.04
  Candidate: 4.9.2-10ubuntu13
  Version table:
     4.9.2-10ubuntu13 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
 *** 4.8.4-2ubuntu1~14.04 0
        100 /var/lib/dpkg/status
libxapian22:
  Installed: (none)
  Candidate: 1.2.19-1
  Version table:
     1.2.19-1 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
     1.2.16-2ubuntu1 0
        100 /var/lib/dpkg/status

Updates

$ sudo apt-get install libstdc++6=4.9.2-10ubuntu13 :
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libstdc++6
0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.

and

$ apt-cache policy libstdc++6
libstdc++6:
  Installed: 4.8.4-2ubuntu1~14.04
  Candidate: 4.9.2-10ubuntu13
  Version table:
     4.9.2-10ubuntu13 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
 *** 4.8.4-2ubuntu1~14.04 0
        100 /var/lib/dpkg/status

,

$ sudo dpkg -i libstdc++6_4.9.2-10ubuntu13_amd64.deb
(Reading database ... 103371 files and directories currently installed.)
Preparing to unpack libstdc++6_4.9.2-10ubuntu13_amd64.deb ...
Unpacking libstdc++6:amd64 (4.9.2-10ubuntu13) over (4.9.2-10ubuntu13) ...
dpkg: dependency problems prevent configuration of libstdc++6:amd64:
 libstdc++6:amd64 depends on gcc-4.9-base (= 4.9.2-10ubuntu13); however:
  Version of gcc-4.9-base:amd64 on system is 4.9.3-0ubuntu4.

dpkg: error processing package libstdc++6:amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libstdc++6:amd64

,

$ sudo apt-get install gcc-4.9-base=4.9.2-10ubuntu13
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.9-base : Breaks: gcc-4.9-base:i386 (!= 4.9.2-10ubuntu13) but 4.9.3-0ubuntu4 is to be installed
 gcc-4.9-base:i386 : Breaks: gcc-4.9-base (!= 4.9.3-0ubuntu4) but 4.9.2-10ubuntu13 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

,

$ apt-cache policy gcc-4.9-base
gcc-4.9-base:
  Installed: 4.9.3-0ubuntu4
  Candidate: 4.9.3-0ubuntu4
  Version table:
 *** 4.9.3-0ubuntu4 0
        100 /var/lib/dpkg/status
     4.9.2-10ubuntu13 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

,

   $ sudo apt-get install gcc-4.9=4.9.2-10ubuntu13 gcc-4.9-base=4.9.2-10ubuntu13 gcc-4.9:i386=4.9.2-10ubuntu13 gcc-4.9-base:i386=4.9.2-10ubuntu13
    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.9 : Depends: cpp-4.9 (= 4.9.2-10ubuntu13) but it is not going to be installed
               Depends: libgcc-4.9-dev (= 4.9.2-10ubuntu13) but it is not going to be installed
               Conflicts: gcc-4.9:i386 but 4.9.2-10ubuntu13 is to be installed
     gcc-4.9:i386 : Depends: cpp-4.9:i386 (= 4.9.2-10ubuntu13) but it is not going to be installed
                    Depends: binutils:i386 (>= 2.25) but it is not going to be installed
                    Depends: libgcc-4.9-dev:i386 (= 4.9.2-10ubuntu13) but it is not going to be installed
                    Depends: libcloog-isl4:i386 (>= 0.17) but it is not going to be installed
                    Depends: libgmp10:i386 (>= 2:5.0.1~) but it is not going to be installed
                    Depends: libisl13:i386 (>= 0.10) but it is not going to be installed
                    Depends: libmpc3:i386 but it is not going to be installed
                    Depends: libmpfr4:i386 (>= 3.1.2) but it is not going to be installed
                    Recommends: libc6-dev:i386 (>= 2.13-0ubuntu6) but it is not going to be installed
                    Conflicts: gcc-4.9 but 4.9.2-10ubuntu13 is to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
share|improve this question
    
Comments are not for extended discussion; this conversation has been moved to chat. – Mitch Feb 2 '16 at 11:41
up vote 1 down vote accepted

The main problem is:

Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04 is to be installed

and the installation of the needed version fails

$ apt-get download libstdc++6
$ sudo dpkg -i libstdc++6_4.9.2-10ubuntu13_amd64.deb
...
dpkg: dependency problems prevent configuration of libstdc++6:amd64:
 libstdc++6:amd64 depends on gcc-4.9-base (= 4.9.2-10ubuntu13); however:
  Version of gcc-4.9-base:amd64 on system is 4.9.3-0ubuntu4.

The output of apt-cache policy gcc-4.9-base says me, you have installed gcc-4.9-base with a DEB file or by a repository, which not longer exist in your system. For this reason:

  1. Downgrade your gcc-4.9 installation and as you have also installed the 32-bit packages, the same for the 32-bit packages.

    But the commands below are not helpful, for that reason we have to go the hard way, see point 2.

    sudo apt-get install gcc-4.9=4.9.2-10ubuntu13 gcc-4.9-base=4.9.2-10ubuntu13 gcc-4.9:i386=4.9.2-10ubuntu13 gcc-4.9-base:i386=4.9.2-10ubuntu13
    
  2. The hard way

    mkdir ~/debs$$
    cd ~/debs$$
    wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9-base_4.9.2-10ubuntu13_amd64.deb
    wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9-base_4.9.2-10ubuntu13_i386.deb
    wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9_4.9.2-10ubuntu13_amd64.deb
    wget http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.9/gcc-4.9_4.9.2-10ubuntu13_i386.deb
    sudo dpkg -i --force-all *.deb
    sudo apt-get install -f
    
  3. Install aptitude

    sudo apt-get install aptitude
    
share|improve this answer
    
Add the output of apt-cache policy gcc-4.9-base to your question. – A.B. Feb 1 '16 at 14:07
    
Have you used the command above? sudo apt-get install gcc-4.9-base=4.9.2-10ubuntu13 – A.B. Feb 1 '16 at 14:20
    
yes! result is the same. – Mohsen Parsaeian Feb 1 '16 at 14:26
    
Give me the error message – A.B. Feb 1 '16 at 14:27
1  
Yesss, it works.Thanks very very much – Mohsen Parsaeian Feb 1 '16 at 21:45

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.