REMOVING:
linux-image-6.12.57+deb13-amd64
Summary:
Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
Freed space: 111 MB
Continue? [Y/n]
│
│ You are running a kernel (version 6.12.57+deb13-amd64) and attempting to remove the same version. │
│ │
│ This can make the system unbootable as it will remove /boot/vmlinuz-6.12.57+deb13-amd64 and all modules under │
│ the directory /lib/modules/6.12.57+deb13-amd64. This can only be fixed with a copy of the kernel image and the │
│ corresponding modules. │
│ │
│ It is highly recommended to abort the kernel removal unless you are prepared to fix the system after removal. │
│ │
│ Abort kernel removal?
On one hand the process tells me it linux-image-6.12.57+deb13-amd64 is no longer needed and on other hands it tells me that it is not a good idea to remove it.
You installed a newer kernel (linux-image-6.12.63+deb13-amd64) but did not restart the system.
It’s not recommended to remove the active kernel, that’s why the message appears.
Why? This is plain Debian apt feature. It has nothing to do with DietPi. It will look like same on all Debian based systems if you install a new kernel and try to remove the binary afterwards without a reboot. Usually this is going to work, but you should reboot the system right after.
root@DietPi:~# dpkg --list | grep linux-image
rc linux-image-6.12.41+deb13-amd64 6.12.41-1 amd64 Linux 6.12 for 64-bit PCs (signed)
rc linux-image-6.12.43+deb13-amd64 6.12.43-1 amd64 Linux 6.12 for 64-bit PCs (signed)
rc linux-image-6.12.48+deb13-amd64 6.12.48-1 amd64 Linux 6.12 for 64-bit PCs (signed)
ii linux-image-6.12.57+deb13-amd64 6.12.57-1 amd64 Linux 6.12 for 64-bit PCs (signed)
ii linux-image-6.12.63+deb13-amd64 6.12.63-1 amd64 Linux 6.12 for 64-bit PCs (signed)
ii linux-image-amd64 6.12.63-1 amd64 Linux for 64-bit PCs (meta-package)
root@DietPi:~#
Also worth noting that the entries with rc are just config leftovers and not installed and functional kernels. ii are installed and configured kernels.
root@DietPi:~# 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
+++-========================================-============-============-===================================
rc linux-image-6.12.41+deb13-amd64 6.12.41-1 amd64 Linux 6.12 for 64-bit PCs (signed)
un linux-image-6.12.41+deb13-amd64-unsigned <none> <none> (no description available)
rc linux-image-6.12.43+deb13-amd64 6.12.43-1 amd64 Linux 6.12 for 64-bit PCs (signed)
un linux-image-6.12.43+deb13-amd64-unsigned <none> <none> (no description available)
rc linux-image-6.12.48+deb13-amd64 6.12.48-1 amd64 Linux 6.12 for 64-bit PCs (signed)
un linux-image-6.12.48+deb13-amd64-unsigned <none> <none> (no description available)
ii linux-image-6.12.57+deb13-amd64 6.12.57-1 amd64 Linux 6.12 for 64-bit PCs (signed)
un linux-image-6.12.57+deb13-amd64-unsigned <none> <none> (no description available)
ii linux-image-6.12.63+deb13-amd64 6.12.63-1 amd64 Linux 6.12 for 64-bit PCs (signed)
un linux-image-6.12.63+deb13-amd64-unsigned <none> <none> (no description available)
ii linux-image-amd64 6.12.63-1 amd64 Linux for 64-bit PCs (meta-package)
un linux-image-generic <none> <none> (no description available)
root@DietPi:~#
it seems that the only way to remove the old versions is:
root@DietPi:~# apt purge linux-image-6.12.41+deb13-amd64
REMOVING:
linux-image-6.12.41+deb13-amd64*
Summary:
Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
Space needed: 0 B / 503 GB available
Continue? [Y/n]