Assistance Needed with GRUB Configuration

Hello,

I hope someone can help me with the issue below. The latest kernel update caused problems with my GRUB configuration, but I managed to get it working again by re-creating GRUB.

Now, when I boot, the GRUB menu appears with a list of kernels:

6.11.8-1.el9.elrepo.x86_64  
6.11.7-1.el9.elrepo.x86_64  
6.10.2-1.el9.elrepo.x86_64  
5.14.0-427.42.1.el9_4.x86_64  

Using grubby, I confirmed the following list of installed kernels:

index=0  
kernel="/boot/vmlinuz-6.11.8-1.el9.elrepo.x86_64"  
...  
index=3  
kernel="/boot/vmlinuz-5.14.0-427.42.1.el9_4.x86_64"  

I want to make the kernel at index=3 - 5.14.0-427.42.1.el9_4.x86_64 the default. I used the following commands:

[root@ws3 ~]# grubby --set-default=/boot/vmlinuz-5.14.0-427.42.1.el9_4.x86_64  
[root@ws3 ~]# grubby --default-kernel
/boot/vmlinuz-5.14.0-427.42.1.el9_4.x86_64
[root@ws3 ~]#grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.conf  
[root@ws3 ~]#reboot  

However, nothing changes. The GRUB menu still appears on boot, and after 5 seconds, it selects the first kernel 6.11.8-1.el9.elrepo.x86_64.

My /etc/default/grub` looks like this:

GRUB_TIMEOUT=5  
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"  
GRUB_SAVEDEFAULT=true  
GRUB_DEFAULT=3  
#GRUB_DEFAULT=saved  
#GRUB_DEFAULT=false  
GRUB_DISABLE_SUBMENU=true  
GRUB_TERMINAL_OUTPUT="console"  
GRUB_CMDLINE_LINUX="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=3809b849-9737-4abb-ad9d-4c47ee758df1 rd.md.uuid=8bb107a9:60b3b90c:ca752dbb:fe53bf1e rd.md.uuid=28846009:8e451f46:95a9426c:b7595c6d rhgb quiet selinux=0"  
GRUB_DISABLE_RECOVERY="true"  
GRUB_ENABLE_BLSCFG=true  

It seems that setting GRUB_DEFAULT=3 has no effect. Is there a way to remove the 6.x kernels so that the 5.14.x kernel moves up the list and becomes the default?

I’d appreciate any guidance you can provide.

Many thanks for your time,
Kabamaru

Are you talking about removal of some kernel packages, or removal of GRUB boot menu entries?

Yes, one can uninstall kernel versions that one does not need. That should remove the corresponding entries too.

Yes, one can remove “just” GRUB boot entries. Since you use the BLS (which is now the default), each entry is in separate file, in /boot/loader/entries/

Hi jlehtone

/boot/loader/entries did the trick

Thank you for your help
All the best