0

I ran sudo apt upgrade and the output included the following. What should I do now? Has my previous kernel been overwritten? I am avoiding powering off my machine, since I am concerned it might not be bootable now.

Setting up linux-firmware (1.187.25) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-46-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-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.11.0-46-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1

Then some lines related to some other general packages, then:

Processing triggers for linux-image-5.13.0-27-generic (5.13.0-27.29~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.13.0-27-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-27-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-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.13.0-27-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.13.0-27-generic (--configure):
 installed linux-image-5.13.0-27-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
 linux-image-5.13.0-27-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
interoception
  • 111
  • 1
  • 6

1 Answers1

0

Solved by following an answer to a similar question.

Seems like some problems with the older kernels. Let's work together step by step to fix this problem.

First, purge all the older kernels which are no longer in use or are causing errors:

 dpkg -l | egrep "linux-(signed|modules|image|headers)" | grep -v $(uname -r | cut -d - -f 1) | awk {'print $2'} | xargs sudo apt purge -y

Run the apt -f again:

sudo apt --fix-broken install

Then I ran sudo apt upgrade and everything went off without a hitch.

interoception
  • 111
  • 1
  • 6