You are not logged in.
Pages: 1
Topic closed
I have both the linux and linux-lts kernels installed and I want to boot into the latest kernel by default, but when I select Arch Linux from GRUB it always boots the LTS kernel. The only way to boot the latest kernel is by selecting it from the advanced options sub-menu in GRUB.
I have read the arch wiki, in particular the section that addresses this specific problem:
https://wiki.archlinux.org/title/GRUB/T … le_entries
This says that I can change it by disabling the advanced options sub-menu in the GRUB config and setting GRUB_DEFAULT which I'm sure will work, except I don't want to disable the sub menu. I have other operating systems installed and I want to keep it clean with a simple list where I can just select 'Arch Linux' and it boots the latest kernel automatically.
The other suggestion on the wiki is to enable GRUB_SAVEDEFAULT but I don't want to do this because I sometimes boot into other operating systems. I want arch to always be the default otherwise I forget to change it back and boot into the wrong operating system which is annoying.
I thought the most recently installed kernel would take precedence so I tried uninstalling and installing the latest kernel and re-generating GRUB but it still boots into the LTS kernel no matter what I do. SO my question is how is GRUB choosing the order of the kernels?
Last edited by Kobrakai (2021-06-06 17:55:28)
Offline
If you read two subheadings further you will see the mention of defining the default entry to boot from without any other intelligence: https://wiki.archlinux.org/title/GRUB/T … menu_entry
As for how it defines that without explicitly setting something the scripts in /etc/grub.d/ are what will be executed by grub-mkconfig to generate a config.
Last edited by V1del (2021-05-22 16:56:57)
Offline
If you read just two subheadings further you will see the mention of defining the default entry to boot from wihtout any other intelligence: https://wiki.archlinux.org/title/GRUB/T … menu_entry
I tried setting it as "1>2" and it just selected the menu option for advanced options, although I just tried it again and waited the 5 seconds and it does actually boot into the latest kernel.
I would still like to know how GRUB decides on the order though, I haven't had this problem with other distributions so there must be a way to change it outside of GRUB.
Offline
I also have the lts and the ck kernel installed and the option 'arch' in grub selects the lts. So I am also curious as to how grub-mkcong decides that the lts kernel should go first as per the OPs question. Changing the default or saved option does not actually answer the question.
Umuntu Ngumuntu Ngabantu
---------------------------------------
a person is a person through other people
Offline
I found a solution to this earlier today. Basically you need to open this file:
/etc/grub.d/10_linux
Look for the line that says:
linux=`version_find_latest $list`
Replace it with this:
linux=`echo $list | tr ' ' '\n' | sort -V | head -1 | cat`
Then regenerate grub with:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Make a backup of the file just in case but it seems to be working for me now.
Offline
Since the latest update to Grub the line in the above fix no longer exists in /etc/grub.d/10_linux. To fix this now change the following line:
reverse_sorted_list=$(echo $list | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -r | sed -e 's/ 1$/.old/; s/ 2$//')
To this:
reverse_sorted_list=$(echo $list | tr ' ' '\n' | sed -e 's/\.old$/ 1/; / 1$/! s/$/ 2/' | version_sort -V | sed -e 's/ 1$/.old/; s/ 2$//')
Then regenerate grub with:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Offline
Thanks. Works for me after updating grub.
Offline
Closing this old solved thread.
Offline
Pages: 1
Topic closed