Score:1

Ubuntu 20.04.3 LTS (Focal Fossa): Error "Package linux-image-generic is not configured" when updating linux-firmware

au flag

I kindly ask somebody experienced to help me with the following painful issue. Recently, my automated software updater suggested me to update linux-firmware. The update failed and I am receiving such message ever since during every update. I tried to google solutions and fix the issue but I never succeeded. Here is the summary of what I tried:

Here is what I obtain after executing sudo apt install linux-firmware:

$ sudo apt install linux-firmware
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-firmware is already the newest version (1.187.24).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-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-92-generic (5.4.0-92.103) ...
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.92.96); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                       No apport report written because MaxReports is reached already
                                                                                     dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-generic; however:
  Package linux-generic is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.103) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-92-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-92-generic (--configure):
 installed linux-image-5.4.0-92-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-firmware
 linux-image-generic
 linux-generic
 linux-generic-hwe-18.04
 initramfs-tools
 linux-image-5.4.0-92-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is the output which I get when I try sudo dpkg --configure -a:

$ sudo dpkg --configure -a                       
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-5.4.0-92-generic; however:
  Package linux-image-5.4.0-92-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 5.4.0.92.96); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
 linux-generic-hwe-18.04 depends on linux-generic; however:
  Package linux-generic is not configured yet.

dpkg: error processing package linux-generic-hwe-18.04 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-generic with 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:
 linux-image-generic
 linux-generic
 linux-firmware
 linux-generic-hwe-18.04
 initramfs-tools

Finally, I also tried sudo apt --fix-broken install:

$ sudo apt --fix-broken install                                     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.24) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-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-92-generic (5.4.0-92.103) ...
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.92.96); however:
  Package linux-image-generic is not configured yet.

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

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report wrrom a previous failure.
                       No apport report written because MaxReports is reached already
                                                                                     dpkg: error processing package linux-gen
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-91-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-91-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-5.4.0-92-generic (5.4.0-92.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-92-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/kubuntu--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-92-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-92-generic (--configure):
 installed linux-image-5.4.0-92-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-firmware
 linux-image-generic
 linux-generic
 linux-generic-hwe-18.04
 initramfs-tools
 linux-image-5.4.0-92-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I hope that somebody will be able to help me with the problem. Thank you very much in advance!

guiverc avatar
cn flag
Does this answer your question? [Error 24 : Write error : cannot write compressed block](https://askubuntu.com/questions/1207958/error-24-write-error-cannot-write-compressed-block)
nobody avatar
gh flag
You have 2 kernel meta packages on your computer one should be enough
Luinorn avatar
au flag
I apologize for my incompleteness. My Ubuntu version is `20.04.3 LTS (Focal Fossa)`
Someone avatar
my flag
@Luinorn Did you tired my answer? What's the result? Is the problem solved? Status, please :)
Score:2
my flag

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

  1. 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
    
  2. Run the apt -f again:

    sudo apt --fix-broken install
    

Alternatively, you could use a little complex way of doing the same.

  1. Remove the post-installation files for the error packages and run a fresh update:

     cd /var/lib/dpkg/info/ && sudo mv linux-firmware* ~/ && sudo mv linux-image-generic* ~/ && sudo mv linux-generic* ~/ && sudo mv linux-generic-hwe-18.0* ~/ && sudo mv initramfs-tools* ~/ && sudo mv linux-image-5.4.0-92-generic* ~/
    
  2. Run apt -f

    sudo apt --fix-broken install 
    
  3. Now, update again:

    sudo apt update && sudo apt upgrade -y
    
  4. Now reinstall the packages:

    sudo apt install linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic
    

An alternative way to do the above steps in one copy-paste friendly line.

sudo dpkg --purge --force-all linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic && sudo apt -f install && sudo apt update && sudo apt upgrade  && sudo apt install linux-firmware linux-image-generic linux-generic linux-generic-hwe-18.04 initramfs-tools linux-image-5.4.0-92-generic
Luinorn avatar
au flag
Thanks @Someone for being so kind and helpful. Neither method worked however. First step of the first recipe gives errors: `Package linux-firmware is not configured yet. Package linux-image-generic is not configured yet...` and similar First step of the second recipe gives: `$ cd /var/lib/dpkg/info/ && sudo mv linux-firmware* ~/ && sudo mv linux-image-generic* ~/ && sudo mv linux-generic* ~/ && sudo mv linux-generic-hwe-18.0* ~/ && sudo mv initramfs-tools* ~/ && sudo mv linux-image-5.4.0-92-generic* ~/ mv: cannot stat 'linux-firmware*': No such file or directory`
Someone avatar
my flag
@Luinorn Hmmm... Can you provide the output of `ls /var/lib/dpkg/info/ | grep linux-firmware`
Luinorn avatar
au flag
Empty. I can see many `linux-base*`, `linux-headers*`, `linux-image*`, `linux-libc*` and `linux-modules*` there.
Luinorn avatar
au flag
Unfortulately, the chat blocks me with message `You must have 20 reputation on The Stack Exchange Network to talk here`.
Someone avatar
my flag
Ok then we don't seem to have a choice.
Someone avatar
my flag
I'm gonna reply you in a few minutes
Someone avatar
my flag
Well... I won't guarantee you but yes we can. When ever you want me to join the room, just ping me here. If I would be online I'll join.
Luinorn avatar
au flag
Sorry, I spotted you in the chat but I had a call. How about now?
Someone avatar
my flag
@Luinorn Please accept this answer. We've already talked about this in the chat, right? :)
Luinorn avatar
au flag
Done. Thank you very much once again @Someone. You are true samaritan!
Someone avatar
my flag
@Luinorn I'm happy to help you! Have fun! Good luck!
interoception avatar
et flag
@Someone, could you summarize what ended up working, please? I am having a similar issue, which I made a post about.
interoception avatar
et flag
Never mind -- following the instructions in your answer, followed by `sudo apt upgrade` was successful. Thanks!
interoception avatar
et flag
Ah, yes. There you go.
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.