-4

While upgrading from Ubuntu 14 to Ubuntu 16 via do-release-upgrade, I ended up with the following relocation error:

apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0: symbol _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4_, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

as described here. https://github.com/Microsoft/WSL/issues/1216

And couldn't use apt any more. I solved this (as suggested in the link above) by installing:

sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.12_amd64.deb

Now, apt works again, but I have ended with broken dependencies:

 libstdc++-5-dev : Depends: libstdc++6 (>= 5.5.0-12ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.12 is installed
 libstdc++-6-dev : Depends: libstdc++6 (>= 6.5.0-2ubuntu1~14.04.1) but 5.4.0-6ubuntu1~16.04.12 is installed
 libstdc++-7-dev : Depends: libstdc++6 (>= 7.5.0-3ubuntu1~14.04.1) but 5.4.0-6ubuntu1~16.04.12 is installed
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.12) but 5.5.0-12ubuntu1~14.04 is installed

Does someone have an idea on how to fix this?

It seems as if the upgrade process didn't correctly upgrade gcc5 from trusty to xenial, see:

sudo dpkg --list gcc-5
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                      Architecture                 Description
+++-==============================================-============================-============================-=================================================================================================
ii  gcc-5                                          5.5.0-12ubuntu1~14.04        amd64                        GNU C compiler

Thanks in advance!

1 Answers1

0

Ok, I just found the solution. Here for anyone who encounters a similar problem:

wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.12_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i gcc-5-base_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/gcc-5_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i gcc-5_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/g++-5_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i g++-5_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/cpp-5_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i cpp-5_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i libstdc++-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i libgcc-5-dev_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i libasan2_5.4.0-6ubuntu1~16.04.12_amd64.deb 
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb
sudo dpkg -i libmpx0_5.4.0-6ubuntu1~16.04.12_amd64.deb 
sudo apt -f install
sudo apt autoremove

which leaves me with a clean state.

Side note: apt -f install takes care of the remaining errors by just removing gcc-6 and gcc-7, that were still erroring

The following packages have unmet dependencies:
 libstdc++-6-dev : Depends: libstdc++6 (>= 6.5.0-2ubuntu1~14.04.1) but 5.4.0-6ubuntu1~16.04.12 is installed
 libstdc++-7-dev : Depends: libstdc++6 (>= 7.5.0-3ubuntu1~14.04.1) but 5.4.0-6ubuntu1~16.04.12 is installed

but are not key to trusty. In contrast to gcc-5, where calling apt -f install would have removed thousands of packages including apt, etc.