我的系统架构是AMD64,我安装了i386作为外国拱门并运行sudo apt dist-upgrade
,但完成后,我在使用 apt 时不断收到此错误:
apt-get: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0: symbol ZN3URIcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEB5cxx11Ev version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
即使我使用 aptitude:
aptitude: relocation error: aptitude: symbol ZN3URIcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEB5cxx11Ev version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
有什么解决办法吗?
答案1
这是错误#911090。要解决这个问题,您需要确保apt
和libapt-pkg5.0
包保持同步;您可能需要手动下载它们从本页顶部的链接开始。我还不确定是否有解决办法aptitude
。
答案2
尽管现在已经是 2021 年了,但我刚刚遇到了类似的情况,我发布了我在 Ubuntu 18.04(显然以前是 Ubuntu 16.04)系统上发现的内容。看起来用户在 /usr/local/ 中安装了看起来像是另一个版本的 Ubuntu,并且“apt-get”二进制文件试图使用错误的 libapt-private.so.0.0。我清理了 /usr/local/ 并 apt-get 再次开始工作。希望这会在将来节省某人的时间:
# apt-get update
apt-get: relocation error: apt-get: symbol _Z15InstallPackagesR9CacheFilebbbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK11CommandLine version APTPRIVATE_0.0 not defined in file libapt-private.so.0.0 with link time reference
#
# locate libapt-private.so.0.0
/usr/lib/x86_64-linux-gnu/libapt-private.so.0.0
/usr/lib/x86_64-linux-gnu/libapt-private.so.0.0.0
/usr/local/lib/x86_64-linux-gnu/libapt-private.so.0.0
/usr/local/lib/x86_64-linux-gnu/libapt-private.so.0.0.0
#
# ls -l /usr/local
total 104
drwxr-xr-x 2 root root 65536 Jul 7 19:30 bin
drwxr-xr-x 5 root root 4096 Jul 7 14:35 DELETEME
drwxr-xr-x 2 root root 4096 Jul 24 2018 etc
drwxr-xr-x 2 root root 4096 Jul 24 2018 games
drwxr-xr-x 2 root root 4096 Jul 24 2018 include
drwxr-xr-x 153 root root 4096 Sep 22 2020 lib
lrwxrwxrwx 1 root root 9 Sep 17 2018 man -> share/man
drwxr-xr-x 3 root root 4096 Jun 6 2007 opteronkiller
drwxr-xr-x 2 root root 4096 Sep 17 2018 sbin
drwxr-xr-x 13 root root 4096 Oct 20 2020 share
drwxr-xr-x 2 root root 4096 Jul 24 2018 src
#
#
# mv /usr/local/lib /usr/local/lib-foo
# ls -l /usr/local
total 104
drwxr-xr-x 2 root root 65536 Jul 7 19:30 bin
drwxr-xr-x 5 root root 4096 Jul 7 14:35 DELETEME
drwxr-xr-x 2 root root 4096 Jul 24 2018 etc
drwxr-xr-x 2 root root 4096 Jul 24 2018 games
drwxr-xr-x 2 root root 4096 Jul 24 2018 include
drwxr-xr-x 153 root root 4096 Sep 22 2020 lib-foo
lrwxrwxrwx 1 root root 9 Sep 17 2018 man -> share/man
drwxr-xr-x 3 root root 4096 Jun 6 2007 opteronkiller
drwxr-xr-x 2 root root 4096 Sep 17 2018 sbin
drwxr-xr-x 13 root root 4096 Oct 20 2020 share
drwxr-xr-x 2 root root 4096 Jul 24 2018 src
#
# apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Ign:3 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 Release
Hit:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:7 http://archive.canonical.com/ubuntu bionic InRelease
Hit:9 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Reading package lists... Done
#
因此,apt-get
自 9 月 20 日以 root 身份运行的用户安装了/usr/local/lib
.这已经恢复了apt-get
系统所需的功能......不确定它对用户的应用程序造成了什么破坏。这是另一天的故事。