We recently had to install an application that wanted to also update our kernel. I've always had some fear of a kernel update but it's never actually been concrete. It's the same kind of fear as flying. Sure it might be a bit scary but you know deep down that this is all quite safe.
Well planes are falling out of the sky and this linux kernel crashed repeatedly.
At least the kernel failing this bad isn't going to kill me. Well. It might have with how panicky I got.
Anyway now I had a broken kernel and the fix was quite simple. Simply select the old kernel in the grub menu. Easy peasy. Getting to the grub menu was the hardest part because I didn't remember the iDRAC's ip address.
The 570 kernel failed to pick up the partitions and so I reverted to the 475. This however meant that the 570 kernel was now sitting in the grub menu with a higher priority than the 475.
In a normal course of events, this is what you want. However with 570 causing problems, I wanted to remove it completely.
The first thing is to confirm which kernel you are using:
uname -r
The thing to note here is that I'm using RHEL 9 which uses grub2. To list out the available kernels, we can do:
grubby --info ALL
You should also see the kernels under /boot:
ls /boot/vmlinuz*
Once we can see the kernels, then we can find out what package owns a specific kernel by using rpm:
rpm -qf /boot/vmlinuz-*
Once we know the package, we can then remove it using dnf:
dnf remove kernel-core-5.14.0-570.el9.x86_64