4

I just upgraded from 14.04 to 16.04. This wasn't easy, probably because I had a lot of tweaks on my machine (updated packages not installed from "official" sources). It wouldn't boot, I thought at first it was a graphics card problem ("Radeon init error"), but eventually made it boot by downloading (on other machine) libstdc++6 then installing with dpkg -i, using Grub root shell (similar problem as the one here).

I am now able to boot, have the desktop session. Fine.

Now the problem: I have a heavy package dependency problem, all the apt-get commands will fail. Consider this:

$ sudo apt-get check
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:
 libstdc++-5-dev : Depends: libstdc++6 (>= 5.5.0-12ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.10 is installed
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.10) but 5.5.0-12ubuntu1~14.04 is installed
              Breaks: libogre-1.8.0 (<= 1.8.1+dfsg-0ubuntu5) but 1.8.1+dfsg-0ubuntu3 is installed
 libstdc++6:i386 : Depends: gcc-5-base:i386 (= 5.4.0-6ubuntu1~16.04.10) but 5.5.0-12ubuntu1~14.04 is installed
                   Breaks: libogre-1.8.0 (<= 1.8.1+dfsg-0ubuntu5) but 1.8.1+dfsg-0ubuntu3 is installed
E: Unmet dependencies. Try using -f.

The given advice (apt-get -f install) does nothing.

As you can see, what is strange is that there seems to be a mixup of packages from 14.04 and 16.04:

  • libstdc++-5-dev depends on the 14.04 version of libstdc++6, and I have of course the 16.04 version intalled.
  • libstdc++6 depends on a 16.04 package (gcc-5-base) but I seem to still have a 14.04 version!!!

I tried to reinstall the 3 packages with:

sudo apt-get -f install <pkgname> --reinstall

=> unable

I tried to remove libstdc++-5-dev with:

sudo apt-get -f remove libstdc++-5-dev

=> it asks for unmet dependencies of several other packages. If I remove them one by one, I end up at the same point.

I also tried a lot of other things but basically end up at the same point.

Other info:

$ lsb_release -ir 
Distributor ID: Ubuntu
Release:    16.04
$ uname -m
x86_64

Question: how do I get myself out of this dependency problem?

2
  • Where did the libstdc++6 that you installed to fix the boot problem come from? Aug 22, 2018 at 11:32
  • Thanks, just fixed the issue. I came from the official repo, as given here: askubuntu.com/a/792471/69802
    – kebs
    Aug 22, 2018 at 11:33

2 Answers 2

6

Problem solved, thank to this question and its answer (didn't find it at first as the title isn't very explicit, thus I don't withdraw my question, as it might be useful for others).

So, just in case, the solution is:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -f install

(and of course after that: apt-get upgrade and apt autoremoveto finalize).

2
  • 1
    Same identical problem here and your solution worked like a charm!
    – caneta
    Sep 9, 2019 at 15:35
  • thank men, Same identical problem here Sep 12, 2019 at 23:05
1

I had this unmet dependency error. Using Software Updater I installed recommended GCC, GNU C Compiler, GNU C++ Compiler after that I couldn't even restart and get to the login screen. After reading like every solution for two days which none of them worked for me, I combined 2 of them to be able to finally fix the problem.

1- Changed the sources in /etc/apt/sources.list file with the default ones I found here : https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1

sudo leafpad /etc/apt/sources.list

(I use leafpad you can use any other text editor if you prefer)

2- I have learned that aptitude is better at dealing with dependency issues, so I run this command to install gcc

sudo aptitude install gcc

3- Then aptitude suggested me a solution to fix the problem which is a very long list to uninstall crucial packages like arandr, ubuntu-desktop etc. therefore I pressed n and didn't accept the first suggestion, but accepted the second suggestion as follows:

-------------------------------------------------------------
The following actions will resolve these dependencies:

Upgrade the following packages:                                           

1)      gcc-5-base [5.4.0-6ubuntu1~16.04.12 (now, xenial-updates) -> 5.5.0-12ubu
2)      libstdc++6 [5.4.0-6ubuntu1~16.04.12 (now, xenial-updates) -> 9.3.0-10ubu

      Downgrade the following packages:                                         
3)      gcc-9-base [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial
4)      gcc-9-base:i386 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (x
5)      libatomic1 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial
6)      libcc1-0 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)]
7)      libgcc1 [1:9.3.0-11ubuntu0~14.04 (now) -> 1:9.3.0-10ubuntu2~16.04 (xenia
8)      libgcc1:i386 [1:9.3.0-11ubuntu0~14.04 (now) -> 1:9.3.0-10ubuntu2~16.04 (
9)      libgomp1 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)]
10)     libitm1 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)] 
11)     liblsan0 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)]
12)     libobjc4 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)]
13)     libquadmath0 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xeni
14)     libtsan0 [9.3.0-11ubuntu0~14.04 (now) -> 9.3.0-10ubuntu2~16.04 (xenial)]

Accept this solution? [Y/n/q/?] **Y**

and the problem is gone.

You must log in to answer this question.

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