Linux distributions that use binary packages usually install kernel updates in separate directories from previous kernel versions. Therefore, it is possible to have several instances of Linux installed within the same system. This is a precaution that prevents you from overwriting your kernel with one that may not function the way you want, or at all.
On CentOS, it is a good idea to install new kernels and test them to make sure they work before doing anything to the old kernels. After you have confirmed that your current kernel is the one you want to keep, you can then take steps to remove the old ones. Follow these steps to remove old kernels.
- Before proceeding, find out your current kernel version:
The output will look like this
- Find out the names of all kernels currently installed:
rpm -q kernel
The output will look like this:
- Remove the old kernels
rpm -e kernel-2.6.12-1.el5
Perform #3 for all old kernels until they are all gone. Warning: Be extra careful and make sure you do not remove the current kernel. That is why you ran “uname”, to see which kernel is the current default. If you run into any trouble, you should always have at least one kernel remaining that will allow your system to still boot. If you are unsure about this process, just leave it alone. Your system will still function just fine, even with old kernels still installed.