๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #4790

Bug#1145185: apt: Unclear behavior of APT::NeverAutoRemove::KernelCount

#4790
From: Vincent Lefevre
Date: Tue, 17 Nov 2026 05:10
40 lines
3393 bytes
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 <vincent@vinc17.net> - 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)
Technical Details
Message-ID: <O0jC9-coog-15@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
References: <NvisF-cK7O-3@gated-at.bofh.it> <NvisF-cK7O-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Vincent Lefevre <vincent@vinc17.net>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1145185: apt: Unclear behavior of APT::NeverAutoRemove::KernelCount
Date: Tue, 17 Nov 2026 06:10:01 +0100
Message-ID: <O0jC9-coog-15@gated-at.bofh.it>
References: <NvisF-cK7O-3@gated-at.bofh.it> <NvisF-cK7O-3@gated-at.bofh.it>
X-Original-To: Cesare Leonardi <celeonar@gmail.com>, 1145185@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Nov 17 05:07:07 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.651
Reply-To: Vincent Lefevre <vincent@vinc17.net>, 1145185@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: deity@lists.debian.org
X-Debian-Pr-Message: followup 1145185
X-Debian-Pr-Package: apt
X-Debian-Pr-Source: apt
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/2.4.3+67 (b2844dd7) vl-188789 (2026-11-11)
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2003072
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 40
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 17 Nov 2026 06:04:49 +0100
X-Original-Message-ID: <20261117050449.GA980208@qaa.vinc17.org>
X-Original-References: <178749935022.8695.2645496188393653983.reportbug@etna> <178749935022.8695.2645496188393653983.reportbug@etna>