sudo apt update
我正在尝试使用和更新我的 ubuntu 包
sudo apt upgrade
并收到以下消息。
Setting up usrmerge (25ubuntu2) ...
Smartmatch is experimental at /usr/lib/usrmerge/convert-usrmerge line 172.
FATAL ERROR:
Both /lib/x86_64-linux-gnu/libc.so.6 and /usr/lib/x86_64-linux-gnu/libc.so.6 exist.
You can try correcting the errors reported and running again
/usr/lib/usrmerge/convert-usrmerge until it will complete without errors.
Do not install or update other Debian packages until the program
has been run successfully.
dpkg: error processing package usrmerge (--configure):
installed usrmerge package post-installation script subprocess returned error exit status 1
Setting up libllvm13:amd64 (1:13.0.1-2ubuntu2.1) ...
Setting up open-vm-tools (2:11.3.5-1ubuntu4.1) ...
invoke-rc.d: could not determine current runlevel
Setting up libxslt1.1:amd64 (1.1.34-4ubuntu0.22.04.1) ...
Setting up isc-dhcp-common (4.4.1-2.3ubuntu2.2) ...
Setting up ubuntu-advantage-tools (27.10.1~22.04.1) ...
Setting up software-properties-common (0.99.22.3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4) ...
Errors were encountered while processing:
usrmerge
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
操作系统是WSL2下的Ubuntu 22.04:
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
我应该怎样修复这个问题?
我试图删除/lib/x86_64-linux-gnu/libc.so.6
和其中一个/usr/lib/x86_64-linux-gnu/libc.so.6
,但似乎并不能解决这个问题。
提前谢谢了。
更新:
似乎都不是符号链接文件(使用 进行检查ls -l
)。realpath
将每个文件指向其自身,而不是同一个文件。dpkg -S /lib/x86_64-linux-gnu/libc.so.6
给出dpkg -S /lib/x86_64-linux-gnu/libc.so.6
并dpkg -S /usr/lib/x86_64-linux-gnu/libc.so.6
给出dpkg-query: no path found matching pattern /usr/lib/x86_64-linux-gnu/libc.so.6
答案1
我在 Debian 上遇到了同样的问题(升级失败,幸运的是它是一个虚拟机,我能够在另一台虚拟机上安装驱动器并恢复)
据我所知,该软件包正在从一个地方移动到另一个地方,然后放入符号链接,然后用符号链接替换它们。我删除了一个,用指向另一个的符号链接替换它,然后重新运行/usr/lib/usrmerge/convert-usrmerge
、重启并重复,直到所有错误消失。当系统恢复时,我dpkg -S
在每个程序上运行,结果是
# dpkg -S /lib/x86_64-linux-gnu/libc.so.6
libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6
# dpkg -S /usr/lib/x86_64-linux-gnu/libc.so.6
dpkg-query: no path found matching pattern /usr/lib/x86_64-linux-gnu/libc.so.6
我希望这会有所帮助,并且一如既往,YMMV