I know how to remove old Kernels on Ubuntu. But, I don’t know how to do it on CentOS. After googling, I found answer.
Go through and see how many kernels here.
[root@juntixiao ~]# rpm -q kernelkernel-2.6.32-573.3.1.el6.x86_64kernel-2.6.32-573.7.1.el6.x86_64kernel-2.6.32-573.8.1.el6.x86_64 |
Three kernels in machine.
Delete, remove old kernels.
This command is to used to remove old kernels and keep 2 kernels only.
[root@juntixiao ~]# package-cleanup --oldkernels --count=2Loaded plugins: fastestmirror--> Running transaction check---> Package kernel.x86_64 0:2.6.32-573.3.1.el6 will be erased---> Package kernel-devel.x86_64 0:2.6.32-573.3.1.el6 will be erased--> Finished Dependency ResolutionDependencies Resolved================================================================================Package Arch Version Repository Size================================================================================Removing:kernel x86_64 2.6.32-573.3.1.el6 @updates 126 Mkernel-devel x86_64 2.6.32-573.3.1.el6 @updates 25 MTransaction Summary================================================================================Remove 2 Package(s)Installed size: 151 MIs this ok [y/N]: ^CExiting on user CommandComplete![root@juntixiao ~]# package-cleanup --oldkernels --count=2Loaded plugins: fastestmirror--> Running transaction check---> Package kernel.x86_64 0:2.6.32-573.3.1.el6 will be erased---> Package kernel-devel.x86_64 0:2.6.32-573.3.1.el6 will be erased--> Finished Dependency ResolutionDependencies Resolved===============================================================================================================================================================================================================Package Arch Version Repository Size===============================================================================================================================================================================================================Removing:kernel x86_64 2.6.32-573.3.1.el6 @updates 126 Mkernel-devel x86_64 2.6.32-573.3.1.el6 @updates 25 MTransaction Summary===============================================================================================================================================================================================================Remove 2 Package(s)Installed size: 151 MIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionErasing : kernel-2.6.32-573.3.1.el6.x86_64 1/2Erasing : kernel-devel-2.6.32-573.3.1.el6.x86_64 2/2Verifying : kernel-devel-2.6.32-573.3.1.el6.x86_64 1/2Verifying : kernel-2.6.32-573.3.1.el6.x86_64 2/2Removed:kernel.x86_64 0:2.6.32-573.3.1.el6 kernel-devel.x86_64 0:2.6.32-573.3.1.el6Complete!{/shell]If you can not run this command, run following to install it.[shell]yum install yum-utils |





