意外将 libstdc++6:amd64 从 12.1.0-2ubuntu1~22.04 降级至 10-20200411-0ubuntu1

意外将 libstdc++6:amd64 从 12.1.0-2ubuntu1~22.04 降级至 10-20200411-0ubuntu1

为什么尝试获取 gcc/g++ 的调试符号时,我通过运行以下命令意外地将 libstdc++6:i386 和 libstdc++6:amd64 从 12.1.0-2ubuntu1~22.04 降级到 10-20200411-0ubuntu1

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

随后出现类似以下错误

dpkg: warning: downgrading libstdc++6:i386 from 12.1.0-2ubuntu1~22.04 to 10-20200411-0ubuntu1
(Reading database ... 662778 files and directories currently installed.)
Preparing to unpack libstdc++6_10-20200411-0ubuntu1_i386.deb ...
De-configuring libstdc++6:amd64 (12.1.0-2ubuntu1~22.04), to allow configuration of libstdc++6:i386 (12.1.0-2ubuntu1~22.04) ...
Unpacking libstdc++6:i386 (10-20200411-0ubuntu1) over (12.1.0-2ubuntu1~22.04) ...
dpkg: error processing package libstdc++6:i386 (--install):
 package libstdc++6:i386 10-20200411-0ubuntu1 cannot be configured because libstdc++6:amd64 is at a different version (12.1.0-2ubuntu1~22.04)
dpkg: error processing package libstdc++6:amd64 (--install):
 package libstdc++6:amd64 12.1.0-2ubuntu1~22.04 cannot be configured because libstdc++6:i386 is at a different version (10-20200411-0ubuntu1)
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Errors were encountered while processing:
 libstdc++6:i386
 libstdc++6:amd64

现在很多命令不再起作用,特别apt是例如

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

需要建议。

答案1

为了后代的利益,下面是我为解决我的问题所做的事情

获取我意外降级的库的软件包,然后安装它们。

wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libstdc++6_12.1.0-2ubuntu1~22.04_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-12/libstdc++6_12.1.0-2ubuntu1~22.04_i386.deb
sudo dpkg -i libstdc++6_12.1.0-2ubuntu1~22.04_amd64.deb
sudo dpkg -i libstdc++6_12.1.0-2ubuntu1~22.04_i386.deb

--force-all在某些情况下可能需要此选项。

相关内容