[原创] 解决Ubuntu 无法用 apt-get install 安装任何软件(dpkg: error processing package xxx)的问题

Ubuntu不知道什么原因,不能用 apt-get install 安装任何软件了,并且在屏幕上输出海量错误信息,非常迷惑人,例如下面这一例:

insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service vpnagentd_init and mountkernfs if started
insserv:  loop involving service mountkernfs at depth 1
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service vpnagentd_init and dns-clean if started
insserv:  loop involving service dns-clean at depth 1
......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package binfmt-support (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.13.0-32-generic
Errors were encountered while processing:
 udev
 grub-common
 grub2-common
 grub-pc-bin
 grub-pc
 resolvconf
 binfmt-support
E: Sub-process /usr/bin/dpkg returned an error code (1)

这里只列出了部分错误信息,实际上输出的内容极多,多得让人眼都瞎。

原因我不知道,但经过一番Google,我找到了一个解决办法:
cd /var/lib/dpkg/info/

然后:

sudo mv udev.postinst udev.postinst.bak
sudo mv grub-common.postinst grub-common.postinst.bak
...

文章来源:https://www.codelast.com/
其中,命令里的 udev,grub-common 之类的软件包名,就是前面的错误信息里列出来的所有软件包名,当你把所有的那些文件全部重命名之后,再重新执行任何安装软件的命令 sudo apt-get install xxx,就会发现一切正常了。

文章来源:https://www.codelast.com/
➤➤ 版权声明 ➤➤ 
转载需注明出处:codelast.com 
感谢关注我的微信公众号(微信扫一扫):

wechat qrcode of codelast

《[原创] 解决Ubuntu 无法用 apt-get install 安装任何软件(dpkg: error processing package xxx)的问题》有3条评论

发表评论