Note: Doing anything as root can break your system so don’t do it unless you know what you are doing. Part of using Linux is that YOU are responsible for what happens to your computer.
First I usually keep the 3 most recent kernel versions in case there is problem with the current kernel. I then have 2 alternatives that may work in case of a problem.
OK, let’s say I have these:
$ rpm -qa | grep kernel kernel-release-desktop-devel-4.10.13-2omv-1-1-omv2015.0.x86_64 kernel-release-desktop-4.10.13-2omv-1-1-omv2015.0.x86_64 kernel-firmware-extra-20170422-1-omv2015.0.noarch kernel-firmware-20170422-1-omv2015.0.noarch kernel-release-desktop-devel-4.11.2-1omv-1-1-omv2015.0.x86_64 kernel-release-desktop-4.11.2-1omv-1-1-omv2015.0.x86_64 kernel-release-desktop-devel-4.11.3-2omv-1-1-omv2015.0.x86_64 kernel-release-desktop-devel-latest-4.11.3-2-omv2015.0.x86_64 kernel-release-headers-4.11.3-2-omv2015.0.x86_64 kernel-release-desktop-latest-4.11.3-2-omv2015.0.x86_64 kernel-release-desktop-4.11.3-2omv-1-1-omv2015.0.x86_64
and I want to remove the oldest kernel version. Notice I have kernel and kernel devel packages for each kernel version. So when I remove I want to remove both. I can assure a kernel devel package without a kernel package of exactly the same version is useless. Taking the above example I will open Konsole as root and using ‘urpme’ command and copy and paste do this:
# urpme kernel-release-desktop-devel-4.10.13-2omv-1-1-omv2015.0.x86_64 kernel-release-desktop-4.10.13-2omv-1-1-omv2015.0.x86_64
This will rewrite the file ‘/boot/grub2/grub.cfg’ as part of the removal process removing this kernel version from your Grub boot menu. That’s it. That’s all there is to it.