Skip to content
vast-cow's blog
Go back

ELRepo Kernel Configuration with Grubby

Edit page

You can configure it as follows. Whether using kernel-ml or kernel-lt, ELRepo kernels are typically visible as /boot/vmlinuz-*-elrepo.*.

1. Check the ELRepo kernel

sudo grubby --info=ALL | awk 'BEGIN{RS=""} /elrepo/ {print $0 "\n"}'

Or for a quick check:

ls -1 /boot/vmlinuz-*elrepo*

2. Set the latest ELRepo kernel as the default

ELREPO_KERNEL=$(ls -1 /boot/vmlinuz-*elrepo* | sort -V | tail -n 1)

sudo grubby --set-default "$ELREPO_KERNEL"

The official Red Hat documentation also describes using grubby --set-default /boot/vmlinuz-... to permanently change the default kernel. (Red Hat Documentation)

3. Verify the configuration

grubby --default-kernel
grubby --default-index

The expected result is that --default-kernel points to the ELRepo kernel.

Example:

/boot/vmlinuz-6.x.x-x.el9.elrepo.x86_64

ELRepo provides kernel-ml as the mainline stable series and kernel-lt as the long-term support series. (elrepo.org)

4. Verify after reboot

sudo reboot

After booting:

uname -r

If the kernel version contains elrepo, the configuration was successful.

6.x.x-x.el9.elrepo.x86_64

If you want to select only kernel-ml

ELREPO_KERNEL=$(rpm -q kernel-ml --qf '/boot/vmlinuz-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -V | tail -n 1)

sudo grubby --set-default "$ELREPO_KERNEL"
grubby --default-kernel

If you want to select only kernel-lt

ELREPO_KERNEL=$(rpm -q kernel-lt --qf '/boot/vmlinuz-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -V | tail -n 1)

sudo grubby --set-default "$ELREPO_KERNEL"
grubby --default-kernel

Edit page
Share this post:

Comments


Previous Post
Introduction to `gio trash`: Send Files to the Trash Instead of “Deleting” Them in the Linux CLI
Next Post
Creating and Mounting a QEMU qcow2 Image on Ubuntu