[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
---> Package kernel.x86_64 0:3.10.0-1160.24.1.el7 will be erased
---> Package kernel.x86_64 0:3.10.0-1160.36.2.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Removing:
kernel x86_64 3.10.0-1160.15.2.el7 @anaconda 63 M
kernel x86_64 3.10.0-1160.21.1.el7 @updates 63 M
kernel x86_64 3.10.0-1160.24.1.el7 @updates 63 M
kernel x86_64 3.10.0-1160.36.2.el7 @updates 63 M
Transaction Summary
[root@testsvr01~]# rpm -q kernel
kernel-3.10.0-1160.71.1.el7.x86_64