即使触发失败,如何查看包的强制安装?

即使触发失败,如何查看包的强制安装?

有没有办法查看安装包时运行的命令,并说“继续安装包,即使这个特定的命令/触发器失败”?

我正在运行 Ubuntu 18.04,最近做了一个apt-get upgrade。我在这个盒子上做的唯一奇怪的事情就是将引导加载程序从 GRUB 切换到 LILO。LILO 不再积极开发,但它似乎在我的笔记本电脑上运行良好。

尝试升级时initramfs-tools,某些安装后步骤失败,导致所有更改都被撤消。

根据读取错误输出,我猜测可以通过抽查看看它是否正常,然后在包更新后/etc/lilo.conf重新运行来解决此问题。lilo

这是命令和完整输出。

[~] > sudo apt-get install initramfs-tools -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
initramfs-tools is already the newest version (0.130ubuntu3.1).
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.
Setting up initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-33-generic
Fatal: open /dev/disk/by-id/: Is a directory
run-parts: /etc/initramfs/post-update.d//runlilo exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
Exit 100

答案1

我最终解决了这个问题具体问题通过卸载lilo、更新,然后重新安装:

sudo apt-get remove lilo -y
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install lilo -y

安装lilo需要回答一些有关启用大内存支持等的问题。

具体的错误信息可能指的是以下某个文件 /var/lib/dpkg/*

$ grep -r '/etc/initramfs/post-update.d/runlilo' /var/lib/dpkg/info/
/var/lib/dpkg/info/lilo.list:/etc/initramfs/post-update.d/runlilo
/var/lib/dpkg/info/lilo.conffiles:/etc/initramfs/post-update.d/runlilo

但是,我还没能弄清楚要传递哪些选项apt-get才能缩小负责的特定触发器的范围...而且我还还没能弄清楚如何以安全的方式干净地覆盖触发器。

相关内容