Keeping your Linux system up to date with dnf update
is good practice for security and stability. However, sometimes a new kernel update may cause boot problems, leaving you stuck at the boot menu or in a dracut emergency shell. Fortunately, if you can still boot into the previous kernel, the issue is usually easy to fix.
In this article, we’ll go through the common causes and step-by-step solutions to repair a broken kernel boot on AlmaLinux.
Table of Contents
Verify Installed Kernels
First, boot into the last working kernel. Then, list all installed kernels:
rpm -qa | grep kernel-core | sort
You should see multiple versions, such as:
kernel-core-5.14.0-570.33.2.el9_6.x86_64 kernel-core-5.14.0-570.37.1.el9_6.x86_64
The highest version number is usually the latest kernel that fails to boot.
Rebuild the Initramfs for the New Kernel
A common reason for boot failure is a missing or corrupted initramfs. Rebuild it for the new kernel using:
dracut -f /boot/initramfs-5.14.0-570.37.1.el9_6.x86_64.img 5.14.0-570.37.1.el9_6.x86_64
- The first path specifies the initramfs image you want to generate.
- The second argument is the exact kernel version.
Replace
with the version found in the first step with 5.14.0-570.37.1.el9_6.x86_64
rpm -qa
.
Rebuild the GRUB Configuration
Once the initramfs is rebuilt, regenerate your GRUB bootloader configuration:
For BIOS systems:
grub2-mkconfig -o /boot/grub2/grub.cfg
For UEFI systems:
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
Check Kernel Modules (if applicable)
If you use third-party drivers (such as NVIDIA, VirtualBox, or ZFS), they may not yet be built for the new kernel. Rebuild them with:
akmods
or (for DKMS):
dkms autoinstall
Reboot into the Latest Kernel
Now reboot your system and select the latest kernel in the GRUB menu. If all went well, your AlmaLinux server should boot normally.
Kernel updates are essential, but sometimes the initramfs or GRUB configuration can break. By rebuilding the initramfs and refreshing GRUB, you can usually fix the problem without reinstalling or rolling back. Always keep at least one older kernel installed, so you have a fallback option in case the latest version fails. Don’t run
immediately after an update — that way, you’ll always have a fallback if the newest kernel fails.dnf autoremove