3

A while back I installed updates via the GUI updater, and got an error, something similar to linux-firmware post-install script failure. Honestly, I was just happy that the box still booted normally after that, so I let it go. But now I was installing a deb package I downloaded from the terminal, and I saw the errors relating to linux-firmware installation again.

I saw this in the log:

dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-firmware; however:
Package linux-firmware is not configured yet.

and I found a post here to try sudo dpkg --configure -a, but the errors are the same.

Here is the entire log for the above command:

Setting up initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.10) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-66-generic with 1.
dpkg: error processing package linux-firmware (--configure):
installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.4.0-67-generic (5.4.0-67.75) ...
I: /boot/initrd.img.old is now a symlink to initrd.img-5.4.0-67-generic
Setting up linux-image-5.4.0-70-generic (5.4.0-70.78) ...
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-70-generic
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-firmware; however:
Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 5.4.0.70.73); however:
Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-66-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-67-generic (5.4.0-67.75) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.4.0-67-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-67-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-67-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-67-generic (--configure):
installed linux-image-5.4.0-67-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-70-generic (5.4.0-70.78) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.4.0-70-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-70-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-70-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-70-generic (--configure):
installed linux-image-5.4.0-70-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-firmware
linux-image-generic
linux-generic
initramfs-tools
linux-image-5.4.0-67-generic
linux-image-5.4.0-70-generic

So the issue I guess is with mkinitramfs

Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24

I'm running ubuntu on a Dell Precision 5540, with FDE set up following this guide https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019 but I don't know if that has anything to do with it.

It's kind of scary seeing issues with firmware configuration, so I'd like to solve it so it doesn't lead to bigger issues in the future.

1 Answer 1

6

I've had the same issue, and this answer helped me.

My /boot was tiny, and I needed to purge one of the previous Linux images to make room for initramfs-tools to finish. Check /boot and remove one or more of your old image packages with apt purge. Ex:

sudo apt purge linux-image-5.4.0-42-generic

This also triggers initramfs-tools so my next apt upgrade was clear.

Performing a periodic autoremove after your upgrades should keep /boot clear:

sudo apt autoremove

And for the stubborn:

sudo apt autoremove --purge

This is the help document describing the details on more.

2
  • It worked, thanks! Is there a way for apt to only keep the last, say, 3 kernel images? Also which packages do I need to remove to get rid of config-5.4.0-xx-generic and System.map-5.4.0-xx-generic files? Apr 3, 2021 at 18:20
  • I've updated the answer with autoremove. It will keep your last most recent kernel and configurations, so you get 2 after an autoremove. You could wait awhile to keep the 3rd one, or delve into /etc/kernel/postinst.d/apt-auto-removal and /etc/apt/apt.conf.d/01autoremove.
    – codebard
    Apr 5, 2021 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .