不能使用apt:libstdc ++。so.6:找不到版本`GLIBCXX_3.4.20′

当我使用apt我有问题:

$ 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) 

但是,安装新的apt输出:

 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(-) 

即使我尝试下载缺少的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) 

所以我被困在那里,根本无法删除,更新或更正。

您可以从另一个Ubuntu安装中复制libstdc++.so.6

在14.04虚拟机中,我删除了libstdc++.so.6并得到了与您相同的错误。 然后我从我的16.04主机上复制了它,并且再次工作了。 您可以使用Live CD进行此操作。

或者,下载适合您版本的文件:

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

然后使用Cntrl + Alt + T打开终端窗口

  1. 键入cd ~/Downloads并按Enter键
  2. 键入md5sum libstdc++*并按Enter键
  3. 确保您看到以下任一项:

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

  4. 然后使用sudo mv libstdc++* libstdc++.so.6重命名该文件
  5. 移动文件: sudo mv libstdc++.so.6 /usr/lib/x86_64-linux-gnu/

这有点复杂,我不记得当我遇到这个问题时我究竟做了什么。

也许这可以帮助:

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

如果您没有安装python软件属性,这可能不起作用。

因此,请尝试将您的存储库和PPA更新为默认值。 请按照此链接了解如何执行此操作: 如何还原默认存储库?

我之前也遇到过同样的问题。 我通过从这里下载libstdc ++ 6 debian软件包修复它,然后使用’dpkg’进行手动安装

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

在此之后,它运作良好