How to Fix Boot Issues After a Kernel Update

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.



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 5.14.0-570.37.1.el9_6.x86_64 with the version found in the first step with 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 dnf autoremove immediately after an update — that way, you’ll always have a fallback if the newest kernel fails.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x