๐Ÿงฐ Change Default Kernel Version on AlmaLinux 9.4 & CloudLinux 9.4 (Latest)

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

ActionAlmaLinux 9.4 CommandCloudLinux 9.4 Command
List installed kernelsrpm -qa | grep kernel | sortSame
Show bootable kernelsgrubby --info=ALL | grep ^kernelSame
Check current kerneluname -rSame
Change default kernelgrubby --set-default="/boot/vmlinuz-<version>"Use .lve. kernel path
Confirm default kernelgrubby --default-kernelSame
Reboot and verifyreboot && uname -rSame

Scroll to Top