[Linux] Centos7 remove the old kernels

Why removing the old kernels?

  • Even though the old kernels are not harmful to your system, they still take up some space in your disk.
  • The menu of grub2 will become more complex and unuseful, squeezing your custom list to the bottom.

 1.Check Installed Kernels

rpm-qa kernel

 2.Remove Kernels

–count=n, n is the number of kernels YOU WANT TO LEFT.

yum install yum-utils
package-cleanup --oldkernels --count=1

 3.Set Number of Old Kernels Saved

edit /etc/yum.conf

installonly_limit=1

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *