当我尝试运行 sudo apt-get upgrade 时,出现以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libpam-systemd:amd64 (204-5ubuntu20.7) ...
start: Job failed to start
invoke-rc.d: initscript systemd-logind, action "start" failed.
dpkg: error processing package libpam-systemd:amd64 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
这阻止了我安装一些东西,显然出了点问题。有谁知道如何调试?
小智 0
今天我用我们的一个遗留系统来解决这个问题。这个问题是谷歌搜索时的第一个结果之一。所以我在这里留下一个答案。
该问题与https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1325142有关
它因无法修复 libpam-systemd 软件包而被关闭,但长长的评论队列包含一些关于如何临时修复它以克服安装问题的提示。
我们去评论服务重新invoke-rc.d systemd-logind start || exit $?启动
/var/lib/dpkg/info/libpam-systemd\:amd64.postinst
Run Code Online (Sandbox Code Playgroud)
和
/var/lib/dpkg/info/libpam-systemd\:amd64.prerm
Run Code Online (Sandbox Code Playgroud)
然后运行apt-get install设置了修复标志的命令:
apt-get -f install
Run Code Online (Sandbox Code Playgroud)
并恢复了以前版本的安装程序脚本。
当然,这不是最好的“解决方案”,但它让我们去安装其他软件包。