-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!

3
  • 1
    Both your current release as well as the release you con upgrade to are out of support. Even 18.04 that would be the next logical step has only months of support left. So, just don't. Do your backups and install fresh a supported release. Commented Oct 28, 2022 at 18:18
  • Only supported releases of Ubuntu (standard or public support) are on-topic for this site. Ubuntu 14.04 LTS is EOL (end-of-life) thus off-topic, and Ubuntu 14.04 ESM is in extended support and supported by Canonical via Ubuntu Advantage thus also off-topic here. Refer askubuntu.com/help/on-topic help.ubuntu.com/community/EOLUpgrades fridge.ubuntu.com/2019/05/02/…
    – guiverc
    Commented Oct 28, 2022 at 22:09
  • I managed to upgrade in several steps from Ubuntu 14 all the way up to Ubuntu 22. Of course, I know it's a bad idea to reach EOL, but those were not my computers. I just recently started at my institution and was assigned of upgrading those old computers without re-installing anything on them, that's why I asked, even if I know that it's not be best practice... I just follow the orders. And in the future, I will foster that these computers are upgraded to each LTS every two yeras. That being said, the 14 to 16 upgrade was the only one that needed this hack. The other ones went smooth. Commented Oct 31, 2022 at 9:44

1 Answer 1

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.

1

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