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!