Can't update/install apps : dpkg/APT seems to be in a broken state, no space left, missing firmware

My YunoHost server

Hardware: Dedicated computer
YunoHost version: 4.4.2.14
I have access to my server : Through SSH, through the webadmin, direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

:uk:/:us: English / Français

Description of my issue / Description de mon problème

Recently, I tried to update my server and I encountered this error for the first time / Récemment, j’ai essayé de mettre à jour mon serveur et j’ai rencontré cette erreur pour la première fois :

You cannot do this right now because dpkg/APT (the system package managers) seems to be in a broken state… You can try to solve this issue by connecting through SSH and running sudo apt install --fix-broken and/or sudo dpkg --configure -a and/or sudo dpkg --audit.

I tried the command mentionned via CLI, did nothing / J’ai essayé la commande mentionnée via invite de commande, mais pas marché.

admin@macaques:~$ sudo apt install --fix-broken
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages were automatically installed and are no longer required:
equivs linux-image-5.10.0-27-amd64 linux-image-5.10.0-28-amd64 linux-image-5.10.0-29-amd64 php8.1-curl php8.1-intl
php8.1-mysql php8.1-zip
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-5.10.0-31-amd64 (5.10.221-1) …
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-31-amd64
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169

gzip: stdout: No space left on device
E: mkinitramfs failure gzip 1
update-initramfs: failed for /boot/initrd.img-5.10.0-31-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.10.0-31-amd64 (–configure):
installed linux-image-5.10.0-31-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-5.10.0-31-amd64 (= 5.10.221-1); however:
Package linux-image-5.10.0-31-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-5.10.0-31-amd64
linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I searched on this forum and tried different things / J’ai cherché sur le forum et j’ai essayé plusieurs choses :

sudo apt install openssl=1.1.1d-0+deb10u3 --allow-downgrades
[sudo] password for admin:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Version ‘1.1.1d-0+deb10u3’ for ‘openssl’ was not found

Then did :

apt policy openssl
openssl:
Installed: 1.1.1w-0+deb11u1
Candidate: 1.1.1w-0+deb11u1
Version table:
*** 1.1.1w-0+deb11u1 500
500 Index of /debian bullseye/main amd64 Packages
100 /var/lib/dpkg/status
1.1.1n-0+deb11u5 500
500 Index of /debian-security bullseye-security/main amd64 Packages

Then tried / Puis j’ai essayé :

sudo apt install openssl=1.1.1w-0+deb11u1 --allow-downgrades
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
openssl is already the newest version (1.1.1w-0+deb11u1).
openssl set to manually installed.
The following packages were automatically installed and are no longer required:
equivs linux-image-5.10.0-27-amd64 linux-image-5.10.0-28-amd64 linux-image-5.10.0-29-amd64 php8.1-curl php8.1-intl
php8.1-mysql php8.1-zip
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
2 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 linux-image-5.10.0-31-amd64 (5.10.221-1) …
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-31-amd64
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169

gzip: stdout: No space left on device
E: mkinitramfs failure gzip 1########…]
update-initramfs: failed for /boot/initrd.img-5.10.0-31-amd64 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.10.0-31-amd64 (–configure):
installed linux-image-5.10.0-31-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-5.10.0-31-amd64 (= 5.10.221-1); however:
Package linux-image-5.10.0-31-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-5.10.0-31-amd64
linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

What’s interesting / Ce qui intéressant :

  • W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
  • W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
  • W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169
  • gzip: stdout: No space left on device
  • Errors were encountered while processing:
    • linux-image-5.10.0-31-amd64
    • linux-image-amd64

I checked the filesystem / J’ai vérifié filesystem :

df -h
Filesystem Size Used Avail Use% Mounted on
udev 5.9G 0 5.9G 0% /dev
tmpfs 1.2G 864K 1.2G 1% /run
/dev/sda6 457G 105G 329G 25% /
tmpfs 5.9G 88K 5.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda1 230M 190M 24M 89% /boot
tmpfs 1.2G 0 1.2G 0% /run/user/1007

I don’t really know what to do next. Can somebody help me fix this ? / Je ne sais pas vraiment quoi faire ensuite. Quelqu’un peut-il m’aider à résoudre ce problème ?

Thank you / Merci d’avance.

You need to free up some space in /boot, which is usually achieved by uninstalling old kernels

1 Like

Ok, but how can I do that ? Uninstalling apps ? Deleting some backups ?

Or can I increase the size of /boot ?

  • increase size of boot?
    that gets very tricky and comes with risk.

have you tried this command?
sudo apt autoremove

should get rid of extra old kernels you have in /boot.

ref:
https://www.baeldung.com/linux/free-up-boot-space

2 Likes

sudo apt autoremove

[sudo] password for admin:
Sorry, try again.
[sudo] password for admin:
Sorry, try again.
[sudo] password for admin:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following packages will be REMOVED:
equivs linux-image-5.10.0-27-amd64 linux-image-5.10.0-28-amd64 linux-image-5.10.0-29-amd64 php8.1-curl php8.1-intl
php8.1-mysql php8.1-zip
0 upgraded, 0 newly installed, 8 to remove and 64 not upgraded.
2 not fully installed or removed.
After this operation, 955 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 79688 files and directories currently installed.)
Removing equivs (2.3.1) …
Removing linux-image-5.10.0-27-amd64 (5.10.205-2) …
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-27-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.10.0-31-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
Found linux image: /boot/vmlinuz-5.10.0-29-amd64
Found initrd image: /boot/initrd.img-5.10.0-29-amd64
Found linux image: /boot/vmlinuz-5.10.0-28-amd64
Found initrd image: /boot/initrd.img-5.10.0-28-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Removing linux-image-5.10.0-28-amd64 (5.10.209-2) …
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-28-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.10.0-31-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
Found linux image: /boot/vmlinuz-5.10.0-29-amd64
Found initrd image: /boot/initrd.img-5.10.0-29-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Removing linux-image-5.10.0-29-amd64 (5.10.216-1) …
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-29-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.10.0-31-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Removing php8.1-curl (8.1.29-1+0~20240606.65+debian11~1.gbp2ddf4e) …
Removing php8.1-intl (8.1.29-1+0~20240606.65+debian11~1.gbp2ddf4e) …
Removing php8.1-mysql (8.1.29-1+0~20240606.65+debian11~1.gbp2ddf4e) …
Removing php8.1-zip (8.1.29-1+0~20240606.65+debian11~1.gbp2ddf4e) …
Setting up linux-image-5.10.0-31-amd64 (5.10.221-1) …
I: /initrd.img is now a symlink to boot/initrd.img-5.10.0-31-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.10.0-31-amd64
> W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125b-2.fw for module r8169
> W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
> W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.10.0-31-amd64
Found initrd image: /boot/initrd.img-5.10.0-31-amd64
Found linux image: /boot/vmlinuz-5.10.0-30-amd64
Found initrd image: /boot/initrd.img-5.10.0-30-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Setting up linux-image-amd64 (5.10.221-1) …
Processing triggers for php8.1-fpm (8.1.29-1+0~20240606.65+debian11~1.gbp2ddf4e) …
Processing triggers for man-db (2.9.4-2) …

df -h

Filesystem Size Used Avail Use% Mounted on
udev 5.9G 0 5.9G 0% /dev
tmpfs 1.2G 868K 1.2G 1% /run
/dev/sda6 457G 92G 342G 22% /
tmpfs 5.9G 88K 5.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda1 230M 97M 117M 46% /boot
tmpfs 1.2G 0 1.2G 0% /run/user/1007

I checked the available updates and tried to launch the core updates and VOILÀ!

System updates worked. Thank you @Aleks and @arkadi !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.