Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

This article explains how to go back to an older kernel when a new one causes problems, and how to test kernels safely. CentOS 6 is obsolete; the steps are for Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9.

Boot an older kernel now

At the GRUB menu, choose the older kernel (on Ubuntu/Debian under Advanced options). To reach the menu on a VPS, open the VNC console in the VPS dashboard before restarting. Or, from a running system:

grubby --info=ALL | grep -E "^(index|kernel)"     # AlmaLinux / Rocky
grub2-reboot 1 && reboot                          # boot entry 1 once

Make the older kernel the default

grubby --set-default /boot/vmlinuz-5.14.0-570.el9.x86_64     # AlmaLinux / Rocky (use your version)
grubby --default-kernel

On Ubuntu/Debian set GRUB_DEFAULT=saved in /etc/default/grub, run update-grub, then grub-set-default with the menu entry name.

Remove the faulty kernel

dnf remove kernel-core-<version>          # AlmaLinux / Rocky
apt remove linux-image-<version>-generic   # Ubuntu

Never remove the kernel you are running (uname -r).

How it works

GRUB boots the saved default entry. You tell GRUB to try a new kernel once. If it works, you make it the default. If it hangs or panics, the next restart boots the old default again.

AlmaLinux / Rocky Linux 9

  1. List the kernels and their index numbers: grubby --info=ALL | grep -E "^(index|kernel)"
  2. Make sure the current, working kernel is the default: grubby --default-kernel
  3. Let a kernel panic restart the server automatically after 10 seconds: grubby --update-kernel=ALL --args="panic=10"
  4. Boot the new kernel once (index 0 in this example): grub2-reboot 0 && reboot
  5. If the server comes back on the new kernel (uname -r), make it the default: grubby --set-default /boot/vmlinuz-<new-version>. If it did not boot, restart it (on a Ucartz VPS: Stop and Start in the VPS dashboard) and it starts the old kernel.

Ubuntu 24.04 / Debian 12

  1. In /etc/default/grub set GRUB_DEFAULT=saved and add panic=10 to GRUB_CMDLINE_LINUX, then run update-grub.
  2. Save the working kernel as default: grub-set-default "Advanced options for Ubuntu>Ubuntu, with Linux 6.8.0-45-generic" (use the names from grep -E "menuentry|submenu" /boot/grub/grub.cfg).
  3. Try the new kernel once: grub-reboot "Advanced options for Ubuntu>Ubuntu, with Linux 6.8.0-50-generic" && reboot.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket