安装yum-utli: yum install -y yum-utils 设置你想要保留多少旧的内核,比如我想保留两个(最少保留一个): sudo package-cleanup --oldkernels --count=2 reboot 大功告成