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

Bug#979631: APT::Get::AutomaticRemove::Kernels: also allow keeping N newest



On Sat, Jan 09, 2021 at 08:23:55PM +0800, 積丹尼 Dan Jacobson wrote:
> Package: apt
> Version: 2.1.16
> 
> Regarding (/usr/share/doc/apt/examples/configure-index)
> 
>      AutomaticRemove "<BOOL>" {
>         "Kernels" "<BOOL>";     // Allow removing kernels even if not removing other packages (true for dist-upgrade)
>      };
> 
> I would also have another variable, with a digit argument,
> e.g., "2" would keep the two latest unused kernels around.
> 
> In fact the default should be at least "1".
> 
> The new "0" policy, will certainly result in users needing to take their
> computers to the repair shop, as all it will take is one bad kernel,
> and the next time the user tries to boot... they will no longer be able to!

There seems to be a misunderstanding on your side here - we always keep
at least 2 kernels and at most 3, just as we did before (it used to be a
maximum of 4 kernels for some time, but this broke stuff).

We keep:

- the currently booted kernel
- the kernel with the highest version number
- the kernel that was most recently installed

If those are less than 3 kernels, we additionally keep the kernel with
the second highest version number. This ensures a minimum of 2
constraints (and the maximum of 3 constraint there is new, well back).

We could generalize that code to always keep a custom number of kernels
but it surely complicates things a bit (because we do not always want to
keep at least 3 kernels, so we need a different fillup logic for such an
option).

I'd prefer sticking with what we have.
-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en


Reply to: