Celeb Glow
general | April 02, 2026

E: Sub-process /usr/bin/dpkg returned an error code (1) dpkg error

I'm getting this error when running sudo apt upgrade :

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-7634-generic with 1.
dpkg: error processing package linux-firmware (--configure):
installed linux-firmware package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-firmware
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried the following:

sudo apt-get clean
sudo apt upgrade
sudo apt install -f
sudo apt-get dist-upgrade

I also tried flatpak update

$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 390M 1.9M 388M 1% /run
/dev/mapper/data-root 106G 89G 12G 89% /
tmpfs 2.0G 53M 1.9G 3% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop2 56M 56M 0 100% /snap/core18/1885
/dev/loop1 97M 97M 0 100% /snap/core/9665
/dev/loop3 161M 161M 0 100% /snap/gnome-3-28-1804/116
/dev/loop4 162M 162M 0 100% /snap/gnome-3-28-1804/128
/dev/loop5 128K 128K 0 100% /snap/hello-world/29
/dev/loop0 97M 97M 0 100% /snap/core/9804
/dev/loop6 44M 44M 0 100% /snap/snap-store/415
/dev/loop7 227M 227M 0 100% /snap/wine-platform-runtime/145
/dev/loop8 55M 55M 0 100% /snap/core18/1880
/dev/loop9 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop10 227M 227M 0 100% /snap/wine-platform-runtime/136
/dev/sdb1 467M 427M 5.4M 99% /boot
tmpfs 390M 20K 390M 1% /run/user/120
tmpfs 390M 60K 390M 1% /run/user/1000
/dev/sdc1 467M 131M 301M 31% /media/pappkozos/34c06214-5cb6-42b6-b033-9c53b228a584
/dev/sr0 7.5G 7.5G 0 100% /media/pappkozos/empire_disc1
/dev/sdc2 928G 46G 882G 5% /media/pappkozos/Merevlemez
$ df -ih
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 390M 1.9M 388M 1% /run
/dev/mapper/data-root 106G 89G 12G 89% /
tmpfs 2.0G 53M 1.9G 3% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/loop2 56M 56M 0 100% /snap/core18/1885
/dev/loop1 97M 97M 0 100% /snap/core/9665
/dev/loop3 161M 161M 0 100% /snap/gnome-3-28-1804/116
/dev/loop4 162M 162M 0 100% /snap/gnome-3-28-1804/128
/dev/loop5 128K 128K 0 100% /snap/hello-world/29
/dev/loop0 97M 97M 0 100% /snap/core/9804
/dev/loop6 44M 44M 0 100% /snap/snap-store/415
/dev/loop7 227M 227M 0 100% /snap/wine-platform-runtime/145
/dev/loop8 55M 55M 0 100% /snap/core18/1880
/dev/loop9 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop10 227M 227M 0 100% /snap/wine-platform-runtime/136
/dev/sdb1 467M 427M 5.4M 99% /boot
tmpfs 390M 20K 390M 1% /run/user/120
tmpfs 390M 60K 390M 1% /run/user/1000
/dev/sdc1 467M 131M 301M 31% /media/pappkozos/34c06214-5cb6-42b6-b033-9c53b228a584
/dev/sr0 7.5G 7.5G 0 100% /media/pappkozos/empire_disc1
/dev/sdc2 928G 46G 882G 5% /media/pappkozos/Merevlemez
pappkozos@terminator:~$ df -ih
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 476K 607 476K 1% /dev
tmpfs 487K 1.2K 486K 1% /run
/dev/mapper/data-root 6.8M 632K 6.1M 10% /
tmpfs 487K 75 487K 1% /dev/shm
tmpfs 487K 3 487K 1% /run/lock
tmpfs 487K 18 487K 1% /sys/fs/cgroup
/dev/loop2 11K 11K 0 100% /snap/core18/1885
/dev/loop1 13K 13K 0 100% /snap/core/9665
/dev/loop3 28K 28K 0 100% /snap/gnome-3-28-1804/116
/dev/loop4 28K 28K 0 100% /snap/gnome-3-28-1804/128
/dev/loop5 10 10 0 100% /snap/hello-world/29
/dev/loop0 13K 13K 0 100% /snap/core/9804
/dev/loop6 15K 15K 0 100% /snap/snap-store/415
/dev/loop7 28K 28K 0 100% /snap/wine-platform-runtime/145
/dev/loop8 11K 11K 0 100% /snap/core18/1880
/dev/loop9 61K 61K 0 100% /snap/gtk-common-themes/1506
/dev/loop10 28K 28K 0 100% /snap/wine-platform-runtime/136
/dev/sdb1 125K 324 125K 1% /boot
tmpfs 487K 69 487K 1% /run/user/120
tmpfs 487K 103 487K 1% /run/user/1000
/dev/sdc1 125K 20 125K 1% /media/pappkozos/34c06214-5cb6-42b6-b033-9c53b228a584
/dev/sr0 0 0 0 - /media/pappkozos/empire_disc1
/dev/sdc2 882M 26K 882M 1% /media/pappkozos/Merevlemez

My kernel: 5.4.0-7634-generic

My installed kernels:

dpkg --list | egrep -i 'linux-image|linux-headers'
ii linux-headers-5.3.0-7648 5.3.0-7648.41~1586789791~19.10~9593806 all Header files related to Linux kernel version 5.3.0
ii linux-headers-5.3.0-7648-generic 5.3.0-7648.41~1586789791~19.10~9593806 amd64 Linux kernel headers for version 5.3.0 on 64 bit x86 SMP
ii linux-headers-5.4.0-7626 5.4.0-7626.30~1588169883~20.04~bbe668a all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-7626-generic 5.4.0-7626.30~1588169883~20.04~bbe668a amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii linux-headers-5.4.0-7629 5.4.0-7629.33~1589834512~20.04~ff6e79e all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-7629-generic 5.4.0-7629.33~1589834512~20.04~ff6e79e amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii linux-headers-5.4.0-7634 5.4.0-7634.38~1592497129~20.04~9a1ea2e all Header files related to Linux kernel version 5.4.0
ii linux-headers-5.4.0-7634-generic 5.4.0-7634.38~1592497129~20.04~9a1ea2e amd64 Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii linux-headers-generic 5.4.0.7634.38~1592497129~20.04~9a1ea2e amd64 Generic Linux kernel headers
ii linux-image-5.3.0-7648-generic 5.3.0-7648.41~1586789791~19.10~9593806 amd64 Linux kernel image for version 5.3.0 on 64 bit x86 SMP
ii linux-image-5.4.0-7626-generic 5.4.0-7626.30~1588169883~20.04~bbe668a amd64 Linux kernel image for version 5.4.0 on 64 bit x86 SMP
ii linux-image-5.4.0-7629-generic 5.4.0-7629.33~1589834512~20.04~ff6e79e amd64 Linux kernel image for version 5.4.0 on 64 bit x86 SMP
it linux-image-5.4.0-7634-generic 5.4.0-7634.38~1592497129~20.04~9a1ea2e amd64 Linux kernel image for version 5.4.0 on 64 bit x86 SMP
ii linux-image-generic 5.4.0.7634.38~1592497129~20.04~9a1ea2e amd64 Generic Linux kernel image
$ ls -alh /boot
total 226M
drwxr-xr-x 3 root root 4.0K Sep 6 18:18 .
drwxr-xr-x 18 root root 4.0K Sep 6 18:16 ..
-rw-r--r-- 1 root root 231K Apr 13 16:56 config-5.3.0-7648-generic
-rw-r--r-- 1 root root 233K Aug 28 17:31 config-5.4.0-7642-generic
drwxr-xr-x 4 root root 4.0K Sep 6 18:14 grub
lrwxrwxrwx 1 root root 29 Sep 6 17:44 initrd.img -> initrd.img-5.4.0-7642-generic
-rw-r--r-- 1 root root 21M Apr 16 00:08 initrd.img-5.3.0-7642-generic
-rw-r--r-- 1 root root 94M Sep 6 18:18 initrd.img-5.3.0-7648-generic
-rw-r--r-- 1 root root 81M Sep 6 18:18 initrd.img-5.4.0-7642-generic
lrwxrwxrwx 1 root root 29 Apr 15 23:48 initrd.img.old -> initrd.img-5.3.0-7648-generic
-rw------- 1 root root 4.5M Apr 13 16:56 System.map-5.3.0-7648-generic
-rw------- 1 root root 4.6M Aug 28 17:31 System.map-5.4.0-7642-generic
lrwxrwxrwx 1 root root 26 Sep 6 17:44 vmlinuz -> vmlinuz-5.4.0-7642-generic
-rw------- 1 root root 11M Apr 13 16:56 vmlinuz-5.3.0-7648-generic
-rw------- 1 root root 12M Aug 28 17:31 vmlinuz-5.4.0-7642-generic
lrwxrwxrwx 1 root root 26 Apr 15 23:48 vmlinuz.old -> vmlinuz-5.3.0-7648-generic

1 Answer

The first I think:

  • Do you have enough space in boot partition?. Can you paste the output of:
df -h

Also:

df -ih

You can get old kernels removed by this command:

sudo apt --purge autoremove

What version of Ubuntu are you using?.

Edit: After seeing your df -h I can see that /boot is 99% full:

/dev/sdb1 467M 427M 5.4M 99% /boot

You only have 5.4 MB available.

You can manually delete unused or very old kernel in /boot but this has to be very carefully done or you can loss the ability to boot. Also some files can be moved and symbolic links can be created and keep the files in a mountpoint with enough space and after that run

sudo apt --purge autoremove

I can assist if you provide the output of:

ls -alh /boot

Edit 2020-08-25: First see what is your Kernel:

uname -r

You can see the kernels installed in your system with:

dpkg --list | egrep -i 'linux-image|linux-headers'

The kernels that are older, specially if they are very much older, are the first candidates to be deleted. I recommend you to uninstall few of them, two or three only, until you can update your system and after run autopurge.

sudo apt --purge autoremove

You can remove one specific kernel with:

apt-get --purge remove fullkernelname

Normally you'll have to do it in pairs. For example:

apt-get --purge remove linux-headers-4.15.0-111
apt-get --purge remove linux-image-4.15.0-111-generic

Edit 2020-09-01: As you're using Kernel 34 we are going to move two that you are not using:

Type those commands:

sudo mkdir /root/old_kernels
sudo mv /boot/linux-headers-5.4.0-7626* /root/old_kernels/
sudo mv /boot/linux-headers-5.4.0-7629* /root/old_kernels/
sudo ln -s /root/old_kernels/* /boot/

After this you'll have some free space in /boot with the kernel files not deleted, but linked with a symbolic link. This is important so dkpg can find them in order to do autoremove. Now do:

sudo apt update

and after it runs successfully:

sudo apt --purge autoremove

Cheers

24

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy