What's the best way to delete old linux kernel on CentOS 6
Moderator: Staff
What's the best way to delete old linux kernel on CentOS 6
What's the best way to delete old linux kernel on CentOS 6 ?
cPanel Server Management
@ 30$ Onwards
@ 30$ Onwards
Re: What's the best way to delete old linux kernel on CentOS 6
Hello Ashlin,
You can safely remove the unneeded kernels, but always try to keep at least a couple of old kernels to fall back to if there is a problem with an update.
To check Current kernel version
# uname -a
Linux serv.example.com 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
To check All kernel versions installed
# rpm -qa | grep kernel
kernel-smp-2.6.9-42.EL
kernel-smp-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.0.8.EL
To remove old kernel
#rpm -e kernel-smp-2.6.9-42.EL
There is another safe way to manually remove unneeded kernels is by using yum.
First use "yum list" to find out what kernels are installed:
#yum list kernel.*
kernel-smp-2.6.9-42.EL
kernel-smp-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.0.8.EL
#yum remove kernel-smp-2.6.9-42.EL
Also you can keep fewer kernels automatically by editing /etc/yum.conf and change the value installonly_limit=3, so the yum update will keep only latest 3 kernels.
You can safely remove the unneeded kernels, but always try to keep at least a couple of old kernels to fall back to if there is a problem with an update.
To check Current kernel version
# uname -a
Linux serv.example.com 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
To check All kernel versions installed
# rpm -qa | grep kernel
kernel-smp-2.6.9-42.EL
kernel-smp-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.0.8.EL
To remove old kernel
#rpm -e kernel-smp-2.6.9-42.EL
There is another safe way to manually remove unneeded kernels is by using yum.
First use "yum list" to find out what kernels are installed:
#yum list kernel.*
kernel-smp-2.6.9-42.EL
kernel-smp-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.0.8.EL
#yum remove kernel-smp-2.6.9-42.EL
Also you can keep fewer kernels automatically by editing /etc/yum.conf and change the value installonly_limit=3, so the yum update will keep only latest 3 kernels.
Aaron N
Linux Support Engineer.
Nixtree Solutions LLP
Managed Full Server Backups
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree
Linux Support Engineer.
Nixtree Solutions LLP
Managed Full Server Backups
https://www.nixtree.com/managed-backups.php
Follow us on : https://twitter.com/nixtree