Hi,

On 2026-08-23 17:35:50 +0200, Cesare Leonardi wrote:
> For several months I have had the following option set:
> APT::NeverAutoRemove::KernelCount "3";

In the context of

  https://lists.debian.org/debian-user/2026/11/msg00232.html

about this setting, I asked Mistral AI to look at the strange
behavior, and it found a bug:

There is a configuration namespace collision: APT::NeverAutoRemove
is simultaneously a scalar option scope (holding KernelCount) and
a list of regexes that protects packages from autoremove. Setting
KernelCount "3" injects the string 3 into that regex list.

Full details:

  https://chat.mistral.ai/work/80af5892-0370-4bff-8748-652e0fe6666c

> Why does apt propose removing 7.1.6-1 rather than 7.0.13-1 or 7.1.3-1?

It should have removed 7.0.13-1, 7.1.3-1 and 7.1.6-1, but due to
the bug mentioned above, "3" has been added to the regex list,
so that 7.0.13-1 and 7.1.3-1 both match the "3" and are protected.

> Furthermore, after apt removes the proposed version, five kernel
> versions will still be installed, even though I configured it to
> keep three.

The last 3 kernels due to APT::NeverAutoRemove::KernelCount "3" + the
2 protected 7.0.13-1 and 7.1.3-1 kernels due to the "3" in the regex
list.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to