On Sun 15 Mar 2026 at 17:48:30 (-0700), Xiyue Deng wrote:
> Gerard ROBIN <[email protected]> writes:
> > After a recent upgrade, the linux-image-6.19.6+deb14+1-amd64 kernel was
> > installed on my Forky laptop, but when I restart my machine, the old kernel,
> > linux-image-6.19.6+deb14-amd64, is selected by default. So I have two
> > questions:
> >
> > Q1: Why isn't 6.19.6+deb14+1 selected by default?
> > (When I select it manually, it works fine.)
> >
> 
> This seems to be due to the alphabetic sorting order. Considering the 2
> kernel names:
> 
> ,----[ Notice the place marked by ^ ]
> | linux-image-6.19.6+deb14-amd64
> |                         ^ 
> | linux-image-6.19.6+deb14+1-amd64
> |                         ^
> `----
> 
> The ascii code of '+' is 43, and '-' is 45, so '-' is considered a
> bigger value so it's placed in higher precedence.
> 
> (I hope the kernel team can find a better naming scheme, as this is
> really confusing for most users.)

Presumably, something in the process of writing grub.cfg
ought to be using   dpkg --compare-versions   rather than
plain ASCII sorting. (Not sure what that something would be.)
For example:

  ~$ dpkg --compare-versions 6.19.6+deb14+1-amd64 gt 6.19.6+deb14-amd64
  ~$ dpkg --compare-versions 6.19.6+deb14+1-amd64 lt 6.19.6+deb14-amd64
  1 ~$ 

(My bash prompt includes the return code only when it's non-zero.)

Cheers,
David.

Reply via email to