1

When I use apt I have problems:

$ sudo apt-get update
apt-get: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by apt-get) apt-get: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0)

However, installing new apt outputs:

dpkg: regarding .../apt_1.2.10ubuntu1_amd64.deb containing apt:
apt breaks apt-utils (<< 1.1.3)
apt-utils (version 1.0.1ubuntu2) is present and installed.

dpkg: error processing archive /home/anawasreh/Downloads/apt_1.2.10ubuntu1_amd64.deb (--install):
 installing apt would break apt-utils, and
 deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
 /home/anawasreh/Downloads/apt_1.2.10ubuntu1_amd64.deb
(13:13:21)anawasreh@readonly@anawasreh(-)

Even if I try to download the missing lib:

$ sudo apt-get install libstdc++6

apt-get: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
`GLIBCXX_3.4.20' not found (required by apt-get) apt-get:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not
found (required by /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0)

So I'm stuck there and can't remove, update, or correct apt at all.

2

3 Answers 3

3

You could copy libstdc++.so.6 from another Ubuntu installation.

In a 14.04 virtual machine, I removed libstdc++.so.6 and got the same error as you. Then I copied it from my 16.04 host, and apt worked again. You could use a Live CD for this.

Alternatively, download the the right file for your version:

14.04: https://bsre.stackstorage.com/index.php/s/JVNxNO3HWBA4HSa
16.04: https://bsre.stackstorage.com/index.php/s/L394ttygh55cR1W

Then open a Terminal window using Cntrl + Alt + T

  1. Type cd ~/Downloads and press enter
  2. Type md5sum libstdc++* and press enter
  3. Make sure you see either of the following:

    aa688ac2f4c90a023c2cbd1dd21d4ccc libstdc++1404.so.6 68dbd855c3213cae1a41375c25bf6884 libstdc++1604.so.6

  4. Then rename the file using sudo mv libstdc++* libstdc++.so.6
  5. Move the file: sudo mv libstdc++.so.6 /usr/lib/x86_64-linux-gnu/
5
  • There is another error now: [~/Downloads]>apt-get update apt-get: symbol lookup error: apt-get: undefined symbol: _ZN13pkgSrcRecords6Parser6Files2ERSt6vectorINS_5File2ESaIS2_EE
    – Aladdin
    Sep 18, 2016 at 11:44
  • @Aladdin I forgot to ask what architecture you're using. What does uname -m give you?
    – grooveplex
    Sep 18, 2016 at 12:03
  • it is x86_64 ..
    – Aladdin
    Sep 18, 2016 at 12:05
  • @Aladdin And what does lsb_release -a output in the description part?
    – grooveplex
    Sep 18, 2016 at 12:06
  • The output is [~]>lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty
    – Aladdin
    Sep 19, 2016 at 8:39
0

This was little complicated, I dont remember what exactly I had done when I had this problem.

Maybe this can help:

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

This may not work if you dont have python software properties installed.

So,try updating your repositories and PPAs to default. follow this link to know how to do it: How do I restore the default repositories?

1
  • Can't use apt-get sudo apt-get update apt-get: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: invalid ELF header
    – mvladk
    Jan 31, 2019 at 8:08
0

I also had the same problem earlier. I fixed it by downloading libstdc++6 debian package from here and later did a manual install using 'dpkg'

sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.1_i386.deb

After this it apt was working fine

You must log in to answer this question.

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