apt:安装包后自动运行 initramfs

apt:安装包后自动运行 initramfs

我的 Raspberry Pi 4 上安装了 Ubuntu 21.10。当我运行 时apt install <Any package>,它会触发initramfs。如何禁用它?

输出:

Reading package lists... Done Building dependency
tree... Done Reading state information... Done The following
additional packages will be installed:   buildah catatonit conmon
containernetworking-plugins   crun fuse-overlayfs fuse3  
golang-github-containernetworking-plugin-dnsname   golang-github-containers-common  
golang-github-containers-image libfuse3-3   libostree-1-1 podman uidmap Suggested
packages:   containers-storage docker-compose The following
packages will be REMOVED:   fuse The following NEW packages will
be installed:   buildah catatonit cockpit-podman conmon
Selecting previously unselected package fuse-overlayfs.  
Preparing to unpack .../12-fuse-overlayfs_1.4.0-1_arm64.deb ...   
                                                
Unpacking fuse-overlayfs (1.4.0-1) ...                   
Selecting previously unselected package
golang-github-containernetworking-plugin-dnsname.                           Preparing to unpack
.../13-golang-github-containernetworking-plugin-dnsname_1.1.1+ds1-4_arm64.deb ...               Unpacking
golang-github-containernetworking-plugin-dnsname (1.1.1+ds1-4) ...                                       
Setting up crun (0.17+dfsg-1) ...                        
Setting up uidmap (1:4.8.1-1ubuntu9) ...                 
Setting up libostree-1-1:arm64 (2020.8-2) ...            
Setting up golang-github-containers-image (5.12.0-2) ... 
Setting up conmon (2.0.25+ds1-1.1) ...                   
Setting up containernetworking-plugins (0.9.0-1) ...     
Setting up catatonit (0.1.5-2) ...                       
Setting up libfuse3-3:arm64 (3.10.3-2) ...               
Setting up golang-github-containernetworking-plugin-dnsname
(1.1.1+ds1-4) ...                                      
update-initramfs: deferring update (trigger activated)    Setting up
fuse-overlayfs (1.4.0-1) ...                   
                                Installing
/lib/firmware/5.13.0-1015-raspi/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.13.0-1015-raspi/./bcm2711-rpi-4-b.dtb 
                                 Taking backup of
bcm2711-rpi-4-b.dtb.                     Installing new bcm2711-rpi-4-b.dtb. 
                     Installing
/lib/firmware/5.13.0-1015-raspi/device-tree/broadcom/bcm2711-rpi-4-b.dtb into /boot/dtbs/5.13.0-1015-raspi/./bcm2711-rpi-4-b.dtb 
                                 Taking backup of
bcm2711-rpi-4-b.dtb.                     Installing new bcm2711-rpi-4-b.dtb. 
                     Taking backup of spi0-2cs.dtbo.     
                     Installing new spi0-2cs.dtbo.       
                     Taking backup of w1-gpio.dtbo.      
                     Installing new w1-gpio.dtbo.        
                     Installing new rpi-proto.dtbo.      
                     Taking backup of ads1015.dtbo.      
                     Installing new ads1015.dtbo.        
                     Taking backup of max98357a.dtbo.    
                     Installing new max98357a.dtbo.      
                     Taking backup of spi5-1cs.dtbo.     
                     Installing new spi5-1cs.dtbo.       
                     Taking backup of iqaudio-dacplus.dtbo.
                     Installing new iqaudio-dacplus.dtbo. 
                    Taking backup of pca953x.dtbo.       
                    Installing new pca953x.dtbo.         
                    Taking backup of mz61581.dtbo.       
                    Installing new mz61581.dtbo.         
                    Taking backup of spi-rtc.dtbo.       
                    Installing new spi-rtc.dtbo.         
                    Taking backup of hifiberry-dac.dtbo. 
                    Installing new hifiberry-dac.dtbo.   
                    Taking backup of spi2-1cs.dtbo.      
                    Installing new spi2-1cs.dtbo.        
                    Taking backup of w5500.dtbo.         
                    Installing new w5500.dtbo.           
                    Taking backup of cap1106.dtbo.       
                    Installing new cap1106.dtbo.         
                    Taking backup of minipitft13.dtbo.   
                    Installing new minipitft13.dtbo.

抱歉,日志质量较差。

更新:我看见在 Ubuntu 12.04 中安装更新或从软件中心安装时出现错误消息这与我的问题类似,但该帖子中的解决方案对我来说不起作用。

答案1

这是对“如何删除触发器Initramfs”的回答

initramfs包含在您尝试安装的软件包的安装后脚本中。该软件包可能依赖于需要升级的其他软件包initramfs。删除其触发器将危险并可能导致该包无响应。

来自Ubuntu 官方 Wiki 文档

Initramfs 是您的机器可以访问的第一个根文件系统。它用于挂载包含所有数据的真实 rootfs。initramfs 包含挂载 rootfs 所需的模块。但您始终可以编译内核以包含这些模块。那么您是否需要 initramfs?答案是“取决于您的系统”。某些系统配置需要用户空间实用程序来激发内核适当地配置设备。例如:cryptdevices:它们需要用户输入密码。此密码请求实用程序是用户空间实用程序,可能会造成先有鸡还是先有蛋的问题,即您的 rootfs 包含用户空间实用程序,但 rootfs 只有在用户空间实用程序可用时才能启动。在这种情况下,initramfs 充当中间人,提供临时 rootfs,该临时 rootfs 包含挂载真实 rootfs 所需的用户空间实用程序。

您可以按照以下步骤之一将其删除。

  1. 清除它:

    sudo dpkg -P initramfs-tools --force-all
    
  2. 或者,您可以从安装后脚本中删除它。

    通过运行以下命令查找安装后脚本:

    ls /var/lib/dpkg/info | grep <package> | grep ".post"
    

    编辑文件:

    sudo gedit <file name>
    

    删除该update initramfs...线。

  3. 删除 initramfs 的触发器:

    sudo rm -rf /var/lib/dpkg/info/initramfs*
    

以上所有命令 99% 肯定会破坏您的系统。除非您知道自己在做什么,否则请不要运行它们。

祝你好运!

相关内容