-
Notifications
You must be signed in to change notification settings - Fork 0
Change default kernel
Your system can have multiple kernels (or installations) of the same Linux distro. This is typically from having different ISO images, such as EOS Mercury, Titan, and Ganymede. The newest kernel is usually booted by default, but can be adjusted to user preference.
To change the default kernel at system boot, you need to identify and adjust the kernel ids used in the boot loader config file.
Note
This guide is for systems using the default systemd-boot UEFI boot manager in Endeavour OS.
-
Change to the root user with
sudo -sand enter your password. -
Check which kernel is currently set as default with:
$ bootctl list
-
The terminal will display installed kernel information, indicating which kernel was
(selected)at boot, and which one is set as(default).# kernel currently booted and set as default type: Boot Loader Specification Type 1 (.conf) title: EndeavourOS (6.19.11-arch1-1) (default) (selected) # current id: 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1.conf source: ... sort-key: endeavouros-6.19.11-arch1-1 version: 6.19.11-arch1-1 machine-id: 1fcde8d015be4360aa122975ea19eca2 # current default id linux: ... initrd: ... options: ...
# kernel to set as default at boot type: Boot Loader Specification Type 1 (.conf) title: EndeavourOS (6.19.12-arch1-1) id: af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1.conf source: ... sort-key: endeavouros-6.19.12-arch1-1 version: 6.19.12-arch1-1 machine-id: af2ba735c1714a3ebdd24c10355d5b20 # id to set as default ```
-
Copy the
machine-idof the kernel you want to set as the default. In this example:-
Current id:
1fcde8d015be4360aa122975ea19eca2 -
New id:
af2ba735c1714a3ebdd24c10355d5b20
-
Current id:
-
Enter
nano /efi/loader/loader.confto edit the boot loader config in the terminal.
-
On the line containing
default, replace the oldmachine-idwith the updatedid. -
Add a wildcard/asterisk after the
id(no space in between). This ensures the same kernel is booted regardless of release version, which can change after system updates.default af2ba735c1714a3ebdd24c10355d5b20* # add wildcard * timeout 20 # wait time (sec) before system boots default console-mode auto reboot-for-bitlocker 1
-
Double check the kernel
idyou entered is an exact match with the one frombootctl list. -
Press
Ctrl+Xto finish editing, then pressYto save the updated config.
-
Run
bootctl listagain to verify the desired kernel has(default)by the kernel title.type: Boot Loader Specification Type 1 (.conf) title: EndeavourOS (6.19.12-arch1-1) (default) # new default id: af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1.conf source: ... -
Rebootthe system to check that the correct kernel boots by default.
Useful resources:
A list of the installed kernels can also be viewed with the ls command. This does not indicate which kernel is set to default, but has a much simpler terminal output.
-
Enter
ls /efi/loader/entries/to display a list of the kernel entries.$ sudo ls /efi/loader/entries/ 1fcde8d015be4360aa122975ea19eca2-6.18.21-1-lts.conf 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1-fallback.conf 1fcde8d015be4360aa122975ea19eca2-6.18.21-1-lts-fallback.conf af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1.conf 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1.conf af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1-fallback.conf
-
The kernel id is the identifying string in front of the version number.
# kernel id # version number af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1.conf 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1.conf -
Enter
ls -l /efi/loader/entries/to list all kernel entries with last updated dates.$ sudo ls -l /efi/loader/entries/ total 24 -rw-r----- 1 root root 534 Apr 6 03:23 1fcde8d015be4360aa122975ea19eca2-6.18.21-1-lts.conf -rw-r----- 1 root root 565 Apr 6 03:23 1fcde8d015be4360aa122975ea19eca2-6.18.21-1-lts-fallback.conf -rw-r----- 1 root root 542 Apr 6 03:23 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1.conf -rw-r----- 1 root root 573 Apr 6 03:23 1fcde8d015be4360aa122975ea19eca2-6.19.11-arch1-1-fallback.conf -rw-r----- 1 root root 542 Apr 20 18:18 af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1.conf -rw-r----- 1 root root 573 Apr 20 18:18 af2ba735c1714a3ebdd24c10355d5b20-6.19.12-arch1-1-fallback.conf
-
In most cases, the
(selected)kernel is likely the last updated file. In this case, it would be the entry accessed onApr 20 18:18.
Note
While the ls -l does not provide exact details like bootctl list. The simplified output is useful as a quick overview of the kernels installed on your system.
While bootctl list provides detailed information on installed kernels, you can use cat to view the boot loader config file.
-
Enter
sudo cat /efi/loader/loader.confto display the boot loader config.$ sudo cat /efi/loader/loader.conf default af2ba735c1714a3ebdd24c10355d5b20* # kernel id timeout 20 console-mode auto reboot-for-bitlocker 1