Remove Old Kernels on CentOS
If you need to reduce disk usage by cleaning up your
/boot partition, or limit the number of items in your boot list, you can remove old kernels, as well as stop yum from keeping old versions by following this simple tutorial.
Step 1 - List all Installed Linux Kernel Images
You can see a list of all currently installed kernel images and verify which kernel release you're using with the following commands.
Step 2 - Install yum-utils
package-cleanup which will be used to uninstall old unused Linux kernel images.
Step 3 - Uninstall Old Kernels
number with the maximum number of kernels you would like to keep.
Step 4 - Modify Yum Configuration
/etc/yum.conf file and change
installonly_limit to the maximum number of kernel images you would like kept installed.