2

I'm unable to upgrade my system because of broken packages. I've been unable to solve this problem for some months now, and frankly, I'm on the verge of doing a complete reinstall of ubuntu. This post represents my last hope at finding a resolution. Here is what I've tried:

Version info

$ uname -a && gcc --version

Linux prometheus 3.13.0-87-generic #132-Ubuntu SMP Mon May 16 20:51:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
...

Source list

$ grep -v "^#" /etc/apt/sources.list /ect/apt/sources.list.d/*

deb http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-updates main universe multiverse #Added by software-properties  
deb http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-security main universe multiverse #Added by software-properties
deb http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse
deb-src http://za.archive.ubuntu.com/ubuntu/ trusty-backports main universe multiverse #Added by software-properties
deb http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

apt-get stuff

$ sudo apt-get update
...

No issues there...

$ sudo apt-get upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

So it seems like I ended up with multiple versions of gcc somehow! The one being maintained by the package manager being a newer version.

checking out the version table reveals

$ apt-cache policy gcc-4.9-base libgcc1

gcc-4.9-base:
  Installed: 4.9.2-0ubuntu1~12.04
  Candidate: 4.9.3-0ubuntu4
  Version table:
     4.9.3-0ubuntu4 0
        500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
 *** 4.9.2-0ubuntu1~12.04 0
        100 /var/lib/dpkg/status
     4.9-20140406-0ubuntu1 0
        500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
libgcc1:
  Installed: 1:4.9.2-0ubuntu1~12.04
  Candidate: 1:4.9.3-0ubuntu4
  Version table:
     1:4.9.3-0ubuntu4 0
        500 http://za.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
 *** 1:4.9.2-0ubuntu1~12.04 0
        100 /var/lib/dpkg/status
     1:4.9-20140406-0ubuntu1 0
        500 http://za.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

It would seem like I was over-eager when installing gcc 4.9 while still on precise, and now have ended up in this strange muddled state. Retrospectively, that may have been a bad idea. I've tried upgrading gcc via synaptic, but it inevitably wants to remove a crazily long list of packages, (including apt), which seems very undesirable.

So my question is: is there hope of recovering the system and resolving the dependency issues??

Update

$ sudo apt-get install --reinstall gcc-4.9-base libgcc1

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:
 gvfs : Depends: gvfs-daemons (>= 1.20.3-0ubuntu1.2)
        Depends: gvfs-daemons (< 1.20.3-0ubuntu1.2.1~)
 indicator-network : Depends: unity8 (>= 7.82) but it is not going to be installed
 libegl1-mesa : Depends: libgbm1 (>= 7.11~1) but it is not going to be installed
                Recommends: libegl1-mesa-drivers
 libgl1-mesa-glx : Depends: libglapi-mesa (= 10.1.3-0ubuntu0.6)
                   Recommends: libgl1-mesa-dri (>= 7.2)
 libqt5gui5 : Depends: libgbm1 (>= 8.1~0) but it is not going to be installed
 libstdc++6 : Depends: gcc-4.9-base (= 4.9.2-0ubuntu1~12.04) but 4.9.3-0ubuntu4 is to be installed
 libubuntu-application-api-mirserver1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140408.1) but it is not going to be installed
 libunity-mir1 : Depends: libmirserver18 (>= 0.1.8+14.04.20140411) but it is not going to be installed
 unity-scope-mediascanner2 : Depends: mediascanner2.0 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I also tried this fix, to no avail:

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Starting pkgProblemResolver with broken count: 7
Starting 2 pkgProblemResolver with broken count: 7
Investigating (0) libstdc++6 [ amd64 ] < 4.9.2-0ubuntu1~12.04 > ( libs )
Broken libstdc++6:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.2-0ubuntu1~12.04)
  Considering gcc-4.9-base:amd64 17 as a solution to libstdc++6:amd64 525
  Added gcc-4.9-base:amd64 to the remove list
  Fixing libstdc++6:amd64 via keep of gcc-4.9-base:amd64
Investigating (0) libgcc1 [ amd64 ] < 1:4.9.2-0ubuntu1~12.04 -> 1:4.9.3-0ubuntu4 > ( libs )
Broken libgcc1:amd64 Depends on gcc-4.9-base [ amd64 ] < 4.9.2-0ubuntu1~12.04 -> 4.9.3-0ubuntu4 > ( libs ) (= 4.9.3-0ubuntu4)
  Considering gcc-4.9-base:amd64 17 as a solution to libgcc1:amd64 463
  Holding Back libgcc1:amd64 rather than change gcc-4.9-base:amd64
 Try to Re-Instate (0) gcc-4.9-base:amd64
 Try to Re-Instate (1) libgcc1:amd64
Done
Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages have been kept back:
  gcc-4.9-base libgcc1
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

Before trying to force the reinstall, I might try roll back to gcc-4.8 and then try the upgrade again...

3
  • Try use sudo apt-get dist-upgrade instead of just upgrade (I believe this will remove the old version then it will resolve dependencies and install the new). May 26, 2016 at 23:04
  • sudo apt-get dist-upgrade and sudo apt-get -f install both yield the same result as above: The following packages have been kept back: gcc-4.9-base libgcc1 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
    – codeMonkey
    May 27, 2016 at 7:10
  • You can try sudo apt-get dselect-upgrade (I haven't understood exactly the difference with dist-upgrade and there may be a chance to broke your packages but give it a try :P ). May 27, 2016 at 8:07

1 Answer 1

1

O.k. the list of commands are most likely resolving this, remind that the options posted are getting more aggressive, so begin best with solution attempt #1.

1. doing a soft reinstall of the packages:

sudo apt-get install --reinstall gcc-4.9-base libgcc1

2. doing a forced install of broken packages:

sudo apt-get -f install

3. removing by dpkg and reinstalling by apt-get:

sudo dpkg -r --force gcc-4.9-base
sudo dpkg -r --force libgcc1
sudo apt-get install gcc-4.9-base libgcc1

Note: This can and will possibly break your system (e.g. apt), so do not reboot until you have reinstalled those both packages by downloading them and if needed their dependencies from packages.ubuntu.com and installing them with dpkg -i <packacge-name>. Only use this option as a last resort.

3
  • Thx for the answer. Unfortunately removing libgcc1 broke apt, so the only option now seems to be a to start from a clean slate!
    – codeMonkey
    May 27, 2016 at 12:21
  • You can get the packages from packages.ubuntu.com one by one and install them by dpkg -i <packagename>, this way you can probably fix apt in the long run.
    – Videonauth
    May 27, 2016 at 14:44
  • Edited this into my answer for following users.
    – Videonauth
    May 27, 2016 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .