损坏的软件包libparam - 防止内核更新?

分享于 

5分钟阅读

ubuntu

  繁體

问题:

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


$ 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

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


$ 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




$ 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) ...




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包到函数底部的脚本部分。

然后运行dpkg --configure -a,然后完成。


答案2:

我使用 "Nitrux 1.3.0 build.270620" UBUNTU_CODENAME=focal

以下是我在文件libpam-runtime.postinst中注释脚本的行:

#pam-auth-update --package $force
#if [ -n"$force" ]; then
# 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 ]
#then
# cp -a /etc/pam.d/common-session /etc/pam.d/common-session-noninteractive
#fi

运行dpkg --configure -a

成功了!



bro  PAC  PACK  PRE  Runtime  内核  
相关文章