ubuntu sudo apt --fix-broken 安装失败“无法创建备份符号链接”

ubuntu sudo apt --fix-broken 安装失败“无法创建备份符号链接”

尝试修复损坏的安装:

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  systemd
Suggested packages:
  systemd-container
The following packages will be upgraded:
  systemd
1 upgraded, 0 newly installed, 0 to remove and 128 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2903 kB of archives.
After this operation, 4096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 34600 files and directories currently installed.)
Preparing to unpack .../systemd_237-3ubuntu10.25_amd64.deb ...
Unpacking systemd (237-3ubuntu10.25) over (237-3ubuntu10.17) ...
dpkg: error processing archive /var/cache/apt/archives/systemd_237-3ubuntu10.25_amd64.deb (--unpack):
 unable to make backup symlink for './usr/share/man/man8/systemd-sysusers.service.8.gz': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while processing:
 /var/cache/apt/archives/systemd_237-3ubuntu10.25_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ ls ./usr/share/man/man8/systemd-sysusers.service.8.gz
    ./usr/share/man/man8/systemd-sysusers.service.8.gz

错误消息中提到的文件就在那里。我该怎么做才能解决这个问题?

更新:更多详细信息:

ls -ll ./usr/share/man/man8/systemd-sysusers.service.8.gz
-rw-rw-rw- 1 jerryb jerryb 0 Aug 19 13:05 ./usr/share/man/man8/systemd-sysusers.service.8.gz

更新 2:

执行完下面给出的步骤后,我再次尝试。这次我得到了

dpkg: error processing archive /var/cache/apt/archives/systemd_237-3ubuntu10.25_amd64.deb (--unpack):
 unable to make backup symlink for './usr/share/man/man8/systemd-timedated.8.gz': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while p
rocessing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

以及该命令的 ls 输出:

ls -ll ./usr/share/man/man8/systemd-timedated.8.gz
lrwxrwxrwx 1 root root 42 Aug 19 14:25 ./usr/share/man/man8/systemd-timedated.8.gz -> /usr/share/man/man8/systemd-timedated.8.gz

答案1

我发现许多指向 '' 的符号链接。我将它们全部删除,命令成功完成。

相关内容