How to Remove Old Kernel from RHEL Server

[root@testsvr01~]# rpm -q kernel
kernel-3.10.0-1160.15.2.el7.x86_64
kernel-3.10.0-1160.21.1.el7.x86_64
kernel-3.10.0-1160.24.1.el7.x86_64
kernel-3.10.0-1160.36.2.el7.x86_64
kernel-3.10.0-1160.71.1.el7.x86_64
[root@ehapp01 ~]# package-cleanup --oldkernels --count=1
Loaded plugins: fastestmirror, langpacks
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-1160.15.2.el7 will be erased
---> Package kernel.x86_64 0:3.10.0-1160.21.1.el7 will be erased

Subscribe to RHEL