Score:0

apt: Automatically runs initramfs after install package

rs flag

I have Ubuntu 21.10 installed on my Raspberry Pi 4. When I runs apt install <Any package>, it will trigger initramfs. How to disable it?

Output:

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.

Sorry for poor log quality..

Update: I saw When installing updates or from software center in Ubuntu 12.04, error messages which is similar to my issue, but solution in that post is not working for me.

Score:0
my flag

This is answer to "How can I remove triggers for Initramfs"

initramfs is included in the post-installation script of the package you are trying to install. The package might depend on some other package that needs to upgrade initramfs. Removing its triggers will BE DANGEROUS and can make that package unresponsive.

From the official Ubuntu Wiki documentation:

Initramfs is used as the first root filesystem that your machine has access to. It is used for mounting the real rootfs which has all your data. The initramfs carries the modules needed for mounting your rootfs. But you could always compile your kernel to have these modules. Then would you need the initramfs? The answer to this is “depends on your system”. Some system configurations need a user space utility to provoke the kernel to configure the devices appropriately. Eg: cryptdevices : they need to have a password from the user. This password requesting utility being a user space utility, could pose a chicken and egg problem i.e your rootfs contains the user space utilities, but the rootfs cannot come up till the user space utilities are available. In such cases, the initramfs plays a mediator in between giving a temporary rootfs which has bears the user space utilities needed for mounting the real rootfs.

You can remove it by one of the following steps.

  1. Purge it:

    sudo dpkg -P initramfs-tools --force-all
    
  2. Alternatively, you can remove it from the post-installation script.

    Find the post-installation script by running:

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

    Edit the file:

    sudo gedit <file name>
    

    Remove the update initramfs... line.

  3. Remove triggers for initramfs:

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

All of the above commands are 99% guaranteed to break your system. Don't run them unless or until you know what you're doing.

Good Luck!

rs flag
But it will re-flash it when I install **any** package, I'm pretty sure it's not a part of package trigger.
Someone avatar
my flag
@WolfYuan You can check that by looking at the post installation script.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.