Unexpected system crashes, boot failures, or hardware issues often trace back to a recent Linux kernel update. Rolling back to a previous kernel using GRUB not only restores system functionality but also allows you to troubleshoot and resolve compatibility problems without waiting for upstream fixes. This process is crucial for administrators and users who need to keep systems operational, especially when newer kernels disrupt critical drivers or introduce regressions.
Booting Into a Previous Kernel Using GRUB
Shift key (for BIOS systems) or repeatedly pressing Esc (for UEFI systems) during boot displays the GRUB menu. Some distributions may hide this menu by default, requiring these keys to reveal it.Advanced options for [Your Distro] and press Enter. This submenu lists all installed kernel versions alongside their respective recovery modes.Enter to boot into the selected kernel.Join readers who trust AllThings.How
Add us as a preferred source on Google so our practical guides show up first next time you search.
Add to Google Preferences →Setting the Default Kernel in GRUB
If manually selecting the kernel at each boot is inconvenient, you can configure GRUB to automatically boot into your preferred kernel version by default. This ensures system stability across reboots without user intervention.
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/grub2/grub.cfg
This command outputs a numbered list of available boot entries. Note the index number corresponding to your preferred kernel.
sudo grub2-set-default
Replace <index-number> with the appropriate number from the previous step.
sudo grub2-editenv list
Removing a Problematic Kernel
To prevent accidental booting into a faulty kernel, you may want to remove it from your system. This also helps free up space in the /boot partition, which is often limited.
On Debian, Ubuntu, and Derivatives
dpkg --list | grep linux-image
sudo apt remove linux-image-<version>
Replace <version> with the exact version string from the previous list.
sudo update-grub
On Fedora, CentOS, and RHEL
dnf list installed kernel
sudo dnf remove kernel-<version>
sudo rm /boot/vmlinuz-<version> /boot/initramfs-<version>.img
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Downgrading the Kernel Package
In cases where the desired kernel version is not currently installed, you may need to reinstall or downgrade the kernel package. This approach is especially useful if the previous kernel was removed or overwritten.
Debian/Ubuntu-Based Systems
apt list --all-versions linux-image
sudo apt install linux-image-<old-version>
Install matching headers if you use proprietary drivers:
sudo apt install linux-headers-<old-version>
Fedora/CentOS/RHEL Systems
sudo dnf install ./kernel-*.rpm
Arch Linux Systems
sudo pacman -U linux-<old-version>.pkg.tar.zst
Preventing Automatic Kernel Upgrades
Once you’ve rolled back to a stable kernel, you may want to prevent your package manager from automatically updating the kernel until the upstream issue is resolved.
- On Debian/Ubuntu, use APT pinning by creating a file in
/etc/apt/preferences.d/specifying your desired kernel version and a highPin-Priority. - On Fedora/CentOS, add
exclude=kernel*to your/etc/dnf/dnf.confor/etc/yum.conf. - On Arch Linux, add
IgnorePkg = linux linux-headersto/etc/pacman.conf.
Remember to remove these restrictions when you are ready to test new kernel updates, as running outdated kernels for extended periods can expose your system to security vulnerabilities.
Troubleshooting and Best Practices
Boot failures after a kernel downgrade often result from mismatched kernel headers, missing drivers, or incorrect GRUB configurations. Always install matching kernel headers and modules when using proprietary drivers or virtualization tools. If your system becomes unbootable, use a live USB to mount your partitions, chroot into your installation, and repair kernel or GRUB settings.
Maintain at least one additional working kernel on your system for fallback. Back up important data before making kernel changes, and document each step to simplify future troubleshooting or rollbacks. When possible, use only official repositories or distribution archives to source kernel packages, minimizing the risk of introducing security or compatibility issues.
Rolling back your Linux kernel through GRUB restores system reliability when updates cause problems. With careful management of kernels and GRUB settings, you can quickly recover from most kernel-related disruptions and keep your system running smoothly.






