My system suggested I have a package to autoremove but when I did the autoremove command I go to warning the time about to delete the existing kernel and I didnβt read it fully so I clicked no thinking it was to cancel but I actually approved the deletion what should I do?
A new kernel version 6.12 should have been installed. You see it above. The message appears because new kernel 6.12 will be loaded on a reboot only. To be save, reboot first, before attempting to remove the old kernel 6.6
Hey, first off all, thanks for the prompt response and maintaining this awesome project, secondlyβ¦ Uhhh, I already accidentally uninstalled it, what if I reboot and it doesnβt reboot?
usually it should reboot as the new kernel has been installed already. At least it reboots fine on a test system on my side
btw, did you executed apt autoremove
manually?
Yes, I executed manually and it is still running (Iβm afraid to reboot)
Your choice
I did reboot and all is good I think? sudo systemctl reboot
if your system boot up again, yes
I just bumped into this myself. I think this is the same issue. Sorry for OPs encounter happening on April 1st though
Here are three bits I grabbed along the way that tell the story. I aborted, of course.
The following package was automatically installed and is no longer required:
linux-image-6.12.20+rpt-rpi-v8
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
linux-image-6.12.25+rpt-rpi-v8
The following packages will be upgraded:
linux-image-rpi-v8 raspi-firmware
root@DietPi:~# apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
linux-image-6.12.20+rpt-rpi-v8
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 35.7 MB disk space will be freed.
Removing linux-image-6.12.20+rpt-rpi-v8 ββββββββββββββββββ
β β
β You are running a kernel (version 6.12.20+rpt-rpi-v8) and attempting to β
β remove the same version. β
β β
β This can make the system unbootable as it will remove β
β /boot/vmlinuz-6.12.20+rpt-rpi-v8 and all modules under the directory β
β /lib/modules/6.12.20+rpt-rpi-v8. 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?
So there should be a reboot in here at some point? Should it be set up as an automated reboot as part of the process? Or should this upgrade include more detail so the user knows they need to take action on their own?
You are doing this manually? In this case I would recommend to reboot before automove packages.
At least our dietpi-update
script will inform you and offer the reboot to load the new kernel.
Auto-removing the kernel before reboot is also not a real problem. It means kernel modules for the currently loaded kernel cannot be loaded anymore, as they have been removed with the old package. So e.g. if you choose to install Docker or a firewall (iptables
/nftables
) or WireGuard or any such afterwards, which usually requires a kernel module to be loaded, it will fail to start/work until you do the reboot. For this reason, if an old kernel package is removed as part of a DietPi update, you will be prompted with the recommendation to reboot, and dietpi-software
will deny to work until you reboot.
The warning shown on (manual) package removal does not check/know whether you have a new kernel installed and configured, including matching initramfs image and adjusted boot config etc. But the Debian and Raspberry Pi kernel (meta) packages are designed a way that they pull in the new actual/versioned kernel package as new dependency, trigger initramfs and bootloader configs automatically, so that afterwards it is save to remove the old versioned kernel package, which in turn has no dependent anymore.