软件包损坏?Libpam-runtime 阻止内核更新

软件包损坏?Libpam-runtime 阻止内核更新

长期读者第一次发帖。我认为我正在处理 libpam-runtime 的一个损坏的软件包,它会导致内核更新停滞。

在进行更新和升级时,我被告知需要配置软件包

$ sudo apt update && sudo apt upgrade
...
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

然后我运行推荐的命令,但该过程似乎无限期地挂起。

$ sudo dpkg --configure -a
...
Setting up libpam-runtime (1.3.1-5ubuntu4.1) ...

我尝试了sudo apt-get install libpam-runtime,但是它永远挂起了 dpkg,并且我无法再使用任何命令,说dpkg: error: dpkg frontend lock is locked by another process我也无法Ctrl+C退出它。

因此,重新启动后,我尝试删除有问题的软件包并再次安装它。

$ sudo dpkg --remove --force-remove-reinstreq libpam-runtime
dpkg: dependency problems prevent removal of libpam-runtime:
 login depends on libpam-runtime.
 libpam-systemd:amd64 depends on libpam-runtime (>= 1.0.1-6).
 libpam-gnome-keyring:amd64 depends on libpam-runtime (>= 1.0.1-6).
 libpam-cap:amd64 depends on libpam-runtime (>= 1.1.3-2~).
 cron depends on libpam-runtime (>= 1.0.1-11).

dpkg: error processing package libpam-runtime (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 libpam-runtime

我甚至从 Ubuntu 软件包网站下载了该软件包并尝试从本地文件安装它但该过程似乎又无限期地挂在某处。

$ sudo dpkg -i ~/Downloads/libpam-runtime_1.3.1-5ubuntu4.1_all.deb
Selecting previously unselected package libpam-runtime.
(Reading database ... 316308 files and directories currently installed.)
Preparing to unpack .../libpam-runtime_1.3.1-5ubuntu4.1_all.deb ...
Unpacking libpam-runtime (1.3.1-5ubuntu4.1) over (1.3.1-5ubuntu4.1) ...
Setting up libpam-runtime (1.3.1-5ubuntu4.1) ...

当我取消该过程并尝试升级时,它会无限期地停留在 libpam-runtime 上

Extracting templates from packages: 100%
Preconfiguring packages ...
Setting up libpam-runtime (1.3.1-5ubuntu4.1) ...
     

Progress: [  0%] [...............................] ..

有什么可以帮助我吗?我在 Ubuntu 20.04 上使用 KDE Plasma。

$ sudo apt-get install --reinstall libpam-runtime

Reading package lists... Done
Building dependency tree 
Reading state information... Done 

The following package was automatically installed and is no longer required: libnvidia-compute-440 
Use 'sudo apt autoremove' to remove it. 
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 116 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. 

E: Internal Error, No file name for libpam-runtime:amd64

编辑:根据评论中的请求,我检查了 dpkg 的日志,输出如下。

$ dpkg -l | egrep -v '^ii|rc'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=============================================-=======================================-============-======================================================================================================
iF  libpam-runtime                                1.3.1-5ubuntu4.1                        all          Runtime support for the PAM library
hi  libphonon4qt5-4:amd64                         4:4.11.1+p18.04+git20191211.0121-0      amd64        multimedia framework from KDE using Qt 5 - core library
ic  libsensors4:amd64                             1:3.4.0-4                               amd64        library to read temperature/voltage/fan sensors
hi  plasma-pa                                     4:5.18.3-0ubuntu1                       amd64        Plasma 5 Volume controller
ht  ufw                                           0.36-1ubuntu6                           all          program for managing a Netfilter firewall

答案1

所以我在社交媒体上找到了一个解决方法,这是我几乎从不检查的一件事。答案是编辑文件/var/lib/dpkg/info/libpam-runtime.postinst并注释脚本的部分,从执行命令 pam-auth-update package 开始一直到函数底部。

然后只需简单运行即可dpkg --configure -a,然后过程就完成了。

感谢大家的时间和建议!

答案2

我真的是新手,我遇到了与 Sarcasmo 相同的问题!

我使用“Nitrux 1.3.0 build.270620” UBUNTU_CODENAME=focal

刚刚阅读了 Zanna 的解决方案并应用了它。

libpam-runtime.postinst这些是我注释的文件中脚本的行:

#pam-auth-update --软件包 $force

#如果 [ -n "$force" ]; 然后
# rm -f /etc/pam.d/common-auth.pam-old \
#/etc/pam.d/common-account.pam-old \
#/etc/pam.d/common-password.pam-old \
#/etc/pam.d/common-session.pam-old
#elif dpkg --compare-versions "$2" lt-nl 1.1.0-1 \
# && [ !-e /etc/pam.d/common-session-noninteractive ]
#然后
# cp -a /etc/pam.d/common-session /etc/pam.d/common-session-noninteractive
#fi

之后我跑了dpkg --configure -a

而且它成功了!

感谢您的时间和建议!

相关内容