Comment 14 for bug 1914278

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote : Re: apt autoremove is not removing unused kernels

TJ:

linux-image-5.4.0-40-generic/focal-updates,focal-security,now 5.4.0-40.44 amd64 [installed,automatic]
linux-image-5.4.0-40-lowlatency/focal-updates,focal-security,now 5.4.0-40.44 amd64 [installed,automatic]
linux-image-5.4.0-42-generic/focal-updates,focal-security,now 5.4.0-42.46 amd64 [installed,auto-removable]
linux-image-5.4.0-42-lowlatency/focal-updates,focal-security,now 5.4.0-42.46 amd64 [installed,auto-removable]
linux-image-5.4.0-65-generic/focal-updates,focal-security,now 5.4.0-65.73 amd64 [installed]
linux-image-5.4.0-65-lowlatency/focal-updates,focal-security,now 5.4.0-65.73 amd64 [installed]
linux-image-5.8.0-34-generic/focal-updates,focal-security,now 5.8.0-34.37~20.04.2 amd64 [installed,automatic]
linux-image-5.8.0-34-lowlatency/focal-updates,focal-security,now 5.8.0-34.37~20.04.2 amd64 [installed,automatic]
linux-image-5.8.0-41-generic/focal-updates,focal-security,now 5.8.0-41.46~20.04.1 amd64 [installed]
linux-image-5.8.0-41-lowlatency/focal-updates,focal-security,now 5.8.0-41.46~20.04.1 amd64 [installed]
linux-image-generic-hwe-20.04/focal-updates,focal-security,now 5.8.0.41.46~20.04.27 amd64 [installed,automatic]
linux-image-generic/focal-updates,focal-security,now 5.4.0.65.68 amd64 [installed,automatic]
linux-image-lowlatency-hwe-20.04/focal-updates,focal-security,now 5.8.0.41.46~20.04.27 amd64 [installed,automatic]
linux-image-lowlatency/focal-updates,focal-security,now 5.4.0.65.68 amd64 [installed,automatic]

Balint:
Result: https://paste.ubuntu.com/p/JVHZpFWBBT/

It appears as though apt and u-u are doing the job, but for some reason the packages aren't getting marked as autoremovable when they're upgraded? I had to manually mark these as autoremovable (apt-mark linux-image-${version}-${generic|lowlatency} auto) to get u-u or apt to do anything about it. If you look at the list above, even the 5.4.0-65 and 5.4.0-41 kernels are showing up as manually installed, which is not the case (they were installed via their respective metapackages).

So, something is definitely not working as expected.