[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#985771: apt-auto-removal isn't run by kernel update



On Tue, Mar 23, 2021 at 10:18:34AM +0100, Reiner Schulz wrote:
> On 5 of our Debian 10 Server the separate /boot Partition filled up with old kernels
> on a few Server without separate /boot partition are up to 10 old kernel left
> 
> I check if linux-image\* was marked "manual", there where a few on some Server, but not on all.

(Those marked manual will never be removed)


> /etc/kernel/postinst.d/apt-auto-removal should remove all old kernels but the last two

(the logic is slightly more complex than this)


> /etc/kernel/postinst.d/apt-auto-removal isn't run after kernel updates
> 
> How can i check why?

It probably is, but as it is not producing any output to the console
there is also no indication given that it was run (technical hint: That
is a choice being made by the kernel packages, which run the scripts
with "run-parts --report", which is documented to behave that way).


> -- Package-specific info:
[…]
> APT::NeverAutoRemove:: "^linux-image-4\.19\.0-13-amd64$";
> APT::NeverAutoRemove:: "^linux-image-4\.19\.0-14-amd64$";
[…]
> Kernel: Linux 4.19.0-14-amd64 (SMP w/2 CPU cores)

This looks correct and shows its indeed run as expected.

Can you perhaps attach the /etc/apt/apt.conf.d/01autoremove-kernels
file? It it generated by the script and should contain a bunch of debug
information at the end which could help if the generated config is
otherwise wrong (but it doesn't look like that).

It looks for me more like something depends/recommends those kernel
packages though. Out of tree modules perhaps? Try "apt remove -s
linux-image-4.19.0-13-amd64" perhaps that already shows something
although a bit unlikely (as that would only react on hard dependencies,
while recommends, or-groups and virtual packages are more likely).


On a sidenote: Debian 11 will ship with a rework of this kernel removing
more tightly integrated into apt directly. I am inclined to declare this
"fixed" in >= 2.1.16 hence, but lets see first if that is something
which could affect those versions, too (and is something not working "as
designed").


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature


Reply to: