当 dpkg 尝试删除旧内核的片段时,Ubuntu 16.04 和我正在寻找清理损坏软件包的方法,并报告总线错误。无法安装新软件包:
sudo dpkg --purge linux-image-extra-4.4.0-36-generic
(Reading database ... 210811 files and directories currently installed.)
Removing linux-image-extra-4.4.0-36-generic (4.4.0-36.55) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-36-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-36-generic /boot/vmlinuz-4.4.0-36-generic
Bus error (core dumped)
Bus error (core dumped)
run-parts: /etc/kernel/postinst.d/apt-auto-removal exited with return code 135
dpkg: error processing package linux-image-extra-4.4.0-36-generic (--purge):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-36-generic
答案1
这不是最好的解决方案,而且会花费我一天的时间,但我删除了与 linux-image-extra-4.4.0-36-generic 相关的所有文件,并将目录更改为 dpkg
cd /var/lib/dpkg
并从状态文件中删除了与该包相关的描述,在 nano 中使用 Ctrl-W 进行搜索。
sudo nano 状态
到目前为止一切正常......