How to remove old kernels on RSA Security Analytics appliances
Issue
By default, CentOS and many Linux distributions keep a certain number of kernels installed. That number is usually set to 5 although it may be changed by modifying a configuration file on the system.Yum has a feature that will remove old kernels from the host via a simple CLI command.
The setting for number of kernels kept is found in /etc/yum.conf:
cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5 ## This line limits the number of old kernels to 5.
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5 ## This line limits the number of old kernels to 5.
Resolution
Check the /boot/grub/grub.conf file to determine how many kernels are installed and decide on the number of older kernels you would like to remove.Use these steps to remove older kernels no longer needed.
- Logon to the host via ssh as root.
- Make sure yum-utils is installed (as it is normally by default)
rpm -qa | grep yum
root@NWAPPLIANCE001 ~]# rpm -qa | grep yum-util
yum-utils-1.1.30-17.el6_5.noarch
yum-utils-1.1.30-17.el6_5.noarch
- Remove the two older, unwanted kernels with this command:
package-cleanup --oldkernels --count=<#>
-
Remove all but the latest kernel:
[root@NWAPPLIANCE001 ~]# package-cleanup --oldkernels --count=1
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-431.23.3.el6 will be erased
---> Package kernel.x86_64 0:2.6.32-431.29.2.el6 will be erased
Remove all but the last two kernels:
[root@NWAPPLIANCE001 ~]# package-cleanup --oldkernels --count=2
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-431.23.3.el6 will be erased
--> Finished Dependency Resolution
Product Details
RSA Product Set: Security Analytics, NetWitness Logs and PacketsRSA Product/Service Type: Security Analytics Appliance
RSA Version/Condition: 10.4.x, 10.5.x, 10.6.x
Platform: CentOS
O/S Version: EL6
Summary
How to remove old kernels on Security Analytics and Netwitness Logs & Packets Appliances.
Approval Reviewer Queue
RSA NetWitness Suite Approval Queue