Systemd Boot: make higher version the default or remember choice

I installed 6.6 LTS as a backup, and Systemd boot lists the options in alphabetical order and selects the first as the default one. That is:

  • 6.6 <==== default
  • 6.6 fallback
  • 6.9 <==== What I want to be the default
  • 6.9 fallback

But I want the newer version 6.9 (the third option in this case) to the be the default, or at it to remember my last selection. What is the best way? It seems that I can hard-code the default name in the loader.conf file, but that would mean that I have to edit this file each time the kernel version changes.

You can use a wildcard. This exact situation is described in the wiki:

https://discovery.endeavouros.com/installation/systemd-boot/2022/12/

Replace the ID with your ID:

default 665eca4ae83246df8ec17d1cbc6a1763-*-arch?-?.conf
1 Like

How can I, with those “wildcards”, set it to choose the highest kernel number? I mean, I could, for now, set it to use 6.9, but if the kernel version is updated to 7.0, don’t I have to modify the config again and so on for each time the version number changes?

You don’t need to do that.

You will never have 6.9 and 7.0 installed at the same time since that is the same package. That wildcard works for all versions of the linux kernel. When the version switches to the next version it will continue to work as long as they don’t change the naming scheme.

Likewise, linux-lts is a different package which has a different naming scheme.

1 Like

If memory serves me right I recall hitting ‘e’ just before it boots and you’re able to pick another kernel and it remembers that for the following boots.

Either there is more than just pressing e, or it did not work. When I pressed e, it shows a one-line text editor which seems to let the entry’s content. But it didn’t remember the selection.

Just edit the loader.conf file and be done with it. @Dalto gave you the best answer.

Sorry, my memory failed. :sweat_smile:
I pressed ‘d’ and picked the kernel I wanted, but this will work only till you update the kernels.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.