加载共享库时出错:libstdc++.so.6

加载共享库时出错:libstdc++.so.6

当我使用

$apt-get update

输出-error while loading shared libraries:libstdc++.so.6

$apt-file search libstdc++.so.6
File usr/lib/command not found 

我如何添加这个库?


$ lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS 
Release: 18.04 
Codename: bionic

$ apt-cache policy libapt-pkg?.0
apt-cache: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/x86_64-linux-gnu/libapt-pkg.so.6.0) 

答案1

您需要安装对应包手动

wget http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-10/libstdc++6_10-20200411-0ubuntu1_i386.deb
sudo dpkg -i libstdc++6_10-20200411-0ubuntu1_i386.deb

wget http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-10/libstdc++6_10-20200411-0ubuntu1_amd64.deb
sudo dpkg -i libstdc++6_10-20200411-0ubuntu1_amd64.deb

然后你就可以运行

sudo apt update

sudo apt install --reinstall libstdc++6 libstdc++6:i386 libapt-pkg6.0
sudo apt install command-not-found apt-file

相关内容