Troubles removing old kernels on Debian
[Mon Nov 9 11:04:01 CST 2026]

I ran into a weird situation today. I have to install a new kernel upgrade, but my boot partition was starting to run out of disk space. When running the command dpkg -l | grep linux-image, I noticed several old kernel still showed up with an "ii" in the output. And, indeed, checking the contents of the boot partition, I could still see the files there. So, I proceeded to remove them one by one with the usual apt remove <kernel> and, to my surprise, the same kernel versions kept toggling back and forth between the "signed" and "unsigned" versions of the packages, but they never truly went away. A quick search revealed the fix:

# apt purge linux-image- linux-image--unsigned linux-headers- linux-headers--common linux-kbuild-

# dpkg -l | grep linux | grep '^rc' | awk '{print $2}' | xargs apt purge -y
That took care of it. {link to this entry}