1.查看已安装的内核包:
rpm -q kernel
2.安装yum utils:
sudo yum install yum-utils
3.清除旧的内核包(只保留2个)
sudo package-cleanup --oldkernels --count=2
4.修改/etc/yum.conf,设置
installonly_limit=2
参考:http://www.if-not-true-then-false.com/2012/delete-remove-old-kernels-on-fedora-centos-red-hat-rhel/