我安装了 WSL Kali Linux,然后我输入了apt-get update
所以当我输入apt-get dist-upgrade
升级时我看到了这个
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
bsdmainutils : Depends: calendar but it is not installed
Depends: ncal but it is not installed
libc-bin : Depends: libc6 (< 2.31) but 2.31-2 is installed
Recommends: manpages but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)
我尝试过apt --fix-broken install
,但错误消息仍在继续:
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
calendar cpp cpp-9 libc-bin libisl22 libmpc3 libmpfr6 ncal
Suggested packages:
cpp-doc gcc-9-locales
Recommended packages:
manpages
The following NEW packages will be installed:
calendar cpp cpp-9 libisl22 libmpc3 libmpfr6 ncal
The following packages will be upgraded:
libc-bin
1 upgraded, 7 newly installed, 0 to remove and 67 not upgraded.
6 not fully installed or removed.
Need to get 0 B/13.4 MB of archives.
After this operation, 34.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libc6:amd64 (2.31-2) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while procesing:
libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是屏幕截图。我真的需要帮助来解决这个问题
答案1
编辑 libc6 的 postinst
vi /var/lib/dpkg/info/libc6\:amd64.postinst
并注释掉该行
set -e
重新运行修复损坏的程序
apt-get --fix-broken install