Here is the updated guide using the latest stable versions of AlmaLinux 9 and CloudLinux 9, as of July 2025:
This guide explains how to check, switch, and verify the default kernel version on the latest AlmaLinux 9.4 and CloudLinux 9.4 using grubby
.
๐ฆ What is grubby
?
grubby
is a command-line utility used on RHEL-based systems to manage GRUB2 bootloader entries. It is the standard way to control which installed kernel version will boot next.
๐ Step 1: List Installed Kernel Versions
๐น Command:
rpm -qa | grep kernel | sort
๐งพ Example Output โ AlmaLinux 9.4:
kernel-5.14.0-427.13.1.el9_4.x86_64
kernel-5.14.0-427.22.1.el9_4.x86_64
kernel-core-5.14.0-427.13.1.el9_4.x86_64
kernel-core-5.14.0-427.22.1.el9_4.x86_64
kernel-modules-5.14.0-427.13.1.el9_4.x86_64
kernel-modules-5.14.0-427.22.1.el9_4.x86_64
๐งพ Example Output โ CloudLinux 9.4:
kernel-5.14.0-427.13.1.lve.el9.x86_64
kernel-5.14.0-427.22.1.lve.el9.x86_64
kernel-core-5.14.0-427.13.1.lve.el9.x86_64
kernel-core-5.14.0-427.22.1.lve.el9.x86_64
kernel-modules-5.14.0-427.13.1.lve.el9.x86_64
kernel-modules-5.14.0-427.22.1.lve.el9.x86_64
๐ Step 2: Get Kernel Boot Paths with grubby
grubby --info=ALL | grep ^kernel
Output:
kernel="/boot/vmlinuz-5.14.0-427.22.1.el9_4.x86_64"
kernel="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
CloudLinux 9.4:
kernel="/boot/vmlinuz-5.14.0-427.22.1.lve.el9.x86_64"
kernel="/boot/vmlinuz-5.14.0-427.13.1.lve.el9.x86_64"
๐ฅ Step 3: Check Current Running Kernel
uname -r
AlmaLinux Example:
5.14.0-427.13.1.el9_4.x86_64
CloudLinux Example:
5.14.0-427.13.1.lve.el9.x86_64
๐งพ Step 4: Show Boot Entry Info for Kernel
grubby --info="/boot/vmlinuz-5.14.0-427.22.1.el9_4.x86_64"
Or CloudLinux:
grubby --info="/boot/vmlinuz-5.14.0-427.22.1.lve.el9.x86_64"
Output:
index=0
kernel="/boot/vmlinuz-5.14.0-427.22.1.el9_4.x86_64"
args="ro crashkernel=auto resume=/dev/mapper/alma-swap rd.lvm.lv=alma/root rd.lvm.lv=alma/swap rhgb quiet"
root="/dev/mapper/alma-root"
initrd="/boot/initramfs-5.14.0-427.22.1.el9_4.x86_64.img"
title="AlmaLinux (5.14.0-427.22.1.el9_4.x86_64) 9.4"
Or for CloudLinux:
title="CloudLinux (5.14.0-427.22.1.lve.el9.x86_64) 9.4"
๐ Step 5: Check Which Kernel Will Boot on Next Reboot
grubby --default-kernel
grubby --grub2 --default-title
grubby --default-index
Example:
/boot/vmlinuz-5.14.0-427.22.1.el9_4.x86_64
or for CloudLinux:
/boot/vmlinuz-5.14.0-427.22.1.lve.el9.x86_64
๐ Step 6: Change Default Kernel for Next Boot
To change to the older version (427.13.1
):
AlmaLinux:
grubby --set-default="/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64"
CloudLinux:
grubby --set-default="/boot/vmlinuz-5.14.0-427.13.1.lve.el9.x86_64"
โ Step 7: Confirm New Default Kernel
grubby --default-kernel
Expected Output:
/boot/vmlinuz-5.14.0-427.13.1.el9_4.x86_64
Or:
/boot/vmlinuz-5.14.0-427.13.1.lve.el9.x86_64
๐ Step 8: Reboot and Check
reboot
After reboot, run:
uname -r
AlmaLinux:
5.14.0-427.13.1.el9_4.x86_64
CloudLinux:
5.14.0-427.13.1.lve.el9.x86_64
โ๏ธ Optional: Prevent DNF from Removing Old Kernels
Edit:
nano /etc/dnf/dnf.conf
Add or edit this line:
installonly_limit=5
โ Summary Table
Action | AlmaLinux 9.4 Command | CloudLinux 9.4 Command |
---|---|---|
List installed kernels | rpm -qa | grep kernel | sort | Same |
Show bootable kernels | grubby --info=ALL | grep ^kernel | Same |
Check current kernel | uname -r | Same |
Change default kernel | grubby --set-default="/boot/vmlinuz-<version>" | Use .lve. kernel path |
Confirm default kernel | grubby --default-kernel | Same |
Reboot and verify | reboot && uname -r | Same |