[SOLVED] Error while updating, no free space

Problem Description
After 6 months of not being able to have my device on, I’ve finally set it up again and tried to update, but it continuously fails.

Removing linux-image-6.1.0-28-arm64 (6.1.119-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-28-arm64
/etc/kernel/postrm.d/z50-raspi-firmware:
cp: error writing '/boot/firmware/initrd.img-6.1.0-37-arm64': No space left on device
run-parts: /etc/kernel/postrm.d/z50-raspi-firmware exited with return code 1
dpkg: error processing package linux-image-6.1.0-28-arm64 (--remove):
 installed linux-image-6.1.0-28-arm64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.1.0-28-arm64
Processing was halted because there were too many errors.
Config is in use.
Illegal snapshot.
Config is in use.
E:Sub-process /usr/bin/dpkg returned an error code (1)

Much like these two:

it seems to be due to an accumulation of linux-images. However unlike those, I can’t seem to remove the offending images with sudo apt autoremove or sudo apt purge linux-image-6.1.0-28-arm64

$ uname -r
6.1.0-29-arm64
$ uname -a
Linux freedombox 6.1.0-29-arm64 #1 SMP Debian 6.1.123-1 (2025-01-02) aarch64 GNU/Linux
$ sudo dpkg -l '*linux-image*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                Version      Architecture Description
+++-===================================-============-============-==============================================
ii  linux-image-6.1.0-25-arm64          6.1.106-3    arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-25-arm64-unsigned <none>       <none>       (no description available)
rH  linux-image-6.1.0-28-arm64          6.1.119-1    arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-28-arm64-unsigned <none>       <none>       (no description available)
ii  linux-image-6.1.0-29-arm64          6.1.123-1    arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-29-arm64-unsigned <none>       <none>       (no description available)
iF  linux-image-6.1.0-37-arm64          6.1.140-1    arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-37-arm64-unsigned <none>       <none>       (no description available)
iU  linux-image-arm64                   6.1.140-1    arm64        Linux for 64-bit ARMv8 machines (meta-package)
un  linux-image-generic                 <none>       <none>       (no description available)
$ sudo apt purge linux-image-6.1.0-28-arm64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  linux-image-6.1.0-28-arm64
0 upgraded, 0 newly installed, 1 to remove and 133 not upgraded.
3 not fully installed or removed.
After this operation, 357 MB disk space will be freed.
Do you want to continue? [Y/n]
quota not working (qgroup not set)
(Reading database ... 118376 files and directories currently installed.)
Removing linux-image-6.1.0-28-arm64 (6.1.119-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-28-arm64
/etc/kernel/postrm.d/z50-raspi-firmware:
cp: error writing '/boot/firmware/initrd.img-6.1.0-37-arm64': No space left on device
run-parts: /etc/kernel/postrm.d/z50-raspi-firmware exited with return code 1
dpkg: error processing package linux-image-6.1.0-28-arm64 (--remove):
 installed linux-image-6.1.0-28-arm64 package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.1.0-28-arm64
Processing was halted because there were too many errors.
Config is in use.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I’m not used to debian, and I’m rather afraid of fumbling my way into deleting the linux it’s currently using. Where do I go from here?

Information

  • FreedomBox version: 25.1
  • Hardware: Raspberry Pi 3 Model B
  • How did you install FreedomBox?: Downloaded image from the website and installed on a microsd

From your commands, when you try to purge the 6.1.0-28 kernel, apt tries to write something for the 6.1.0-37 kernel, which fails as something (since you are on raspi3B, my guess is the /boot/firmware partition) has not enough space for that.

First: check whether /etc/apt/sources.list refers to stable or to bookworm. If it refers to stable, replace every occurrence of stable with bookworm and run sudo apt update.

Then, what I am saying here probably has risks, but this is what I would try:

  • try purging the 6.1.0-37 kernel first, and if it works, purge all kernels except the one in use
  • when any purge of kernel is said to be successfull, check that what was in /boot/firmware and in /boot for the supposedly removed kernel was really removed. If not, remove it with rm.
  • if that worked, try the update again

It… doesn’t refer to either. O_o

deb http://deb.debian.org/debian trixie main non-free-firmware
deb-src http://deb.debian.org/debian trixie main non-free-firmware

deb http://deb.debian.org/debian trixie-updates main non-free-firmware
deb-src http://deb.debian.org/debian trixie-updates main non-free-firmware

deb http://security.debian.org/debian-security/ trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security/ trixie-security main non-free-firmware

What does that mean?

What does ls -l /etc/apt/sources.list say?

-rw-r--r-- 1 root root 457 Aug 13 21:53 /etc/apt/sources.list

However, I did notice that there’s also a directory called sources.list.d:

$ cat /etc/apt/sources.list.d/freedombox2.list
# This file is managed by FreedomBox, do not edit.
# Allow carefully selected updates to 'freedombox' from backports.

deb http://deb.debian.org/debian bookworm-backports main
deb-src http://deb.debian.org/debian bookworm-backports main

Is this the right one to edit?

/etc/apt/sources.list refers to Debian 13 while /etc/apt/sources.list.d/freedombox2.list refers to Debian 12. This is the kind of situation that I don’t know how to handle properly.

Unless someone else has a proper idea, if you don’t have any data that you need to keep, it might be simpler to do a clean installation using the testing image at Raspberry Pi 3 Model B | FreedomBox - Personal Server at Home, which is most likely Debian 13, so you won’t have the Debian migration trouble.

@Albey Which Debian release is your FreedomBox running on? Is it Bookworm or Trixie? You can check it either on https://example.com/plinth/sys/upgrades/ or by running cat /etc/os-release. Have you tried to perform a system or distribution upgrade from the GUI that ended up broken?

You can manually remove the old kernels or if you want to be extra cautious, you can just move them somewhere else:
mv /boot/initrd.img-6.1.0-25-arm64 /var/backups/
mv /boot/config-6.1.0-25-arm64 /var/backups/

mv /boot/initrd.img-6.1.0-28-arm64 /var/backups/
mv /boot/config-6.1.0-28-arm64 /var/backups/

This should ensure there is enough space under /boot so new kernels can install. After this, please attempt to update from GUI. There is nothing wrong with your apt source files and you should not edit them, as the first line of the drop-in file suggests… FreedomBox is not yet available in trixie-backports, only in bookworm-backports, so that setting is correct.

On my freedombox, when there was an update to trixie (it happened because /etc/apt/sources.list was refering to stable), the freedombox package from bookworm-backports was still kept. Is that the expected behaviour?

According to the above, it is /boot/firmware that is full, so this is where things should be moved from.

Which Debian release is your FreedomBox running on? Is it Bookworm or Trixie? You can check it either on https://example.com/plinth/sys/upgrades/ or by running cat /etc/os-release. Have you tried to perform a system or distribution upgrade from the GUI that ended up broken?

It is bookworm it seems. My initial attempt at upgrading was via the GUI Software Update page.

This should ensure there is enough space under /boot so new kernels can install. After this, please attempt to update from GUI.

I’ve moved the unused kernels and run the GUI update (and after running, /boot/firmware is now at 60% used instead of 100%, so that’s nice).

So, once I removed them all, GUI update told me:

dpkg: dependency problems prevent configuration of linux-image-arm64:
 linux-image-arm64 depends on linux-image-6.1.0-37-arm64 (= 6.1.140-1); however:
  Package linux-image-6.1.0-37-arm64 is not configured yet.

so I put that back and tried again

log from that particular run
Log started: 2025-08-14  15:51:04
Preconfiguring packages ...
Preconfiguring packages ...
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 118304 files and directories currently installed.)
Preparing to unpack .../linux-base_4.12~bpo12+1_all.deb ...
Unpacking linux-base (4.12~bpo12+1) over (4.9) ...
Setting up linux-base (4.12~bpo12+1) ...
Selecting previously unselected package linux-image-6.12.38+deb12-arm64.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 118306 files and directories currently installed.)
Preparing to unpack .../linux-image-6.12.38+deb12-arm64_6.12.38-1~bpo12+1_arm64.deb ...
Unpacking linux-image-6.12.38+deb12-arm64 (6.12.38-1~bpo12+1) ...
Preparing to unpack .../linux-image-arm64_6.12.38-1~bpo12+1_arm64.deb ...
Unpacking linux-image-arm64 (6.12.38-1~bpo12+1) over (6.1.140-1) ...
Setting up linux-image-6.12.38+deb12-arm64 (6.12.38-1~bpo12+1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.1.0-37-arm64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.1.0-37-arm64
I: /vmlinuz is now a symlink to boot/vmlinuz-6.12.38+deb12-arm64
I: /initrd.img is now a symlink to boot/initrd.img-6.12.38+deb12-arm64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.12.38+deb12-arm64
W: No zstd in /usr/bin:/sbin:/bin, using gzip
Setting up linux-image-arm64 (6.12.38-1~bpo12+1) ...

Pending kernel upgrade!

Running kernel version:
  6.1.0-29-arm64

Diagnostics:
  The currently running kernel version is not the expected kernel version 6.12.38+deb12-arm64.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. [Return]

The processor microcode seems to be up-to-date.

Restarting services...

Service restarts being deferred:
 systemctl restart NetworkManager.service
 /etc/needrestart/restart.d/dbus.service
 systemctl restart systemd-logind.service
 systemctl restart unattended-upgrades.service
 systemctl restart wpa_supplicant.service

No containers need to be restarted.

User sessions running outdated binaries:
 admin @ session #415: sshd[236228]
 admin @ user manager service: systemd[236236]

No VM guests are running outdated hypervisor (qemu) binaries on this host.
Log ended: 2025-08-14  15:56:22

I’ve run it and restarted a few times now, but even though I don’t see errors, and every time it’s just a little different, it still doesn’t seem to be upgrading.

3 more logs
Log started: 2025-08-14  16:19:23
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 126692 files and directories currently installed.)
Removing python3-gpg (1.18.0-3+b1) ...
Log ended: 2025-08-14  16:19:31

Log started: 2025-08-14  16:19:34
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 126594 files and directories currently installed.)
Removing libxcb-dri2-0:arm64 (1.15-1) ...
Processing triggers for libc-bin (2.36-9+deb12u9) ...
Log ended: 2025-08-14  16:19:40

Log started: 2025-08-14  17:36:43
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 126588 files and directories currently installed.)
Removing linux-image-6.1.0-29-arm64 (6.1.123-1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-29-arm64
/etc/kernel/postrm.d/z50-raspi-firmware:
raspi-firmware: deleting obsolete /boot/firmware/vmlinuz-6.1.0-29-arm64 (no longer in /boot)
Log ended: 2025-08-14  17:37:09

This seems to be healthier now, tho:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                     Version           Architecture Description
+++-========================================-=================-============-==============================================
ii  linux-image-6.1.0-25-arm64               6.1.106-3         arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-25-arm64-unsigned      <none>            <none>       (no description available)
rc  linux-image-6.1.0-28-arm64               6.1.119-1         arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-28-arm64-unsigned      <none>            <none>       (no description available)
ii  linux-image-6.1.0-29-arm64               6.1.123-1         arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-29-arm64-unsigned      <none>            <none>       (no description available)
ii  linux-image-6.1.0-37-arm64               6.1.140-1         arm64        Linux 6.1 for 64-bit ARMv8 machines (signed)
un  linux-image-6.1.0-37-arm64-unsigned      <none>            <none>       (no description available)
ii  linux-image-6.12.38+deb12-arm64          6.12.38-1~bpo12+1 arm64        Linux 6.12 for 64-bit ARMv8 machines (signed)
un  linux-image-6.12.38+deb12-arm64-unsigned <none>            <none>       (no description available)
ii  linux-image-arm64                        6.12.38-1~bpo12+1 arm64        Linux for 64-bit ARMv8 machines (meta-package)
un  linux-image-generic                      <none>            <none>       (no description available)

I’m gonna’ keep clicking update and see if anything else shows up… :sweat_smile:

In the end I just re-installed with the Testing version of FreedomBox.

I can’t edit my thread title to mark as “solved” or anything, and technically it’s not “solved” per-se, but it’s been dealt with.

Not entirely sure how to avoid getting into that situation again, or notice it before it becomes too much of a problem. :thinking:

Do you have the raspi-firmware package installed?

Asking because I saw [SOLVED] Raspberry Pi Not Removing Old Kernels

1 Like

Well, I do now. No idea if it was installed on my above setup. Thanks for the link, tho. Good to know