Thursday 13 October 2022

How to Maintain Specific Number of Kernel Packages on CentOS 7



Sometime due to less space on /boot partition need remove old kernel packages once new/updated kernel installed. The “installonly_limit” option in /etc/yum.conf is used to maintain the number of kernel available. By default the limit is set to 3 kernels in CentOS 7. 
 
This article describes How to Maintain Specific Number of Kernel Packages on CentOS 7.
 
Step 1. Yum Configuration File: Run the following command to open and edit the yum configuration file:

[root@linuxcnf ~]# vi /etc/yum.conf
[main]
installonly_limit = 2
……………………..
……………………..
[root@linuxcnf ~]#

 
The “installonly_limit” should be more than 1. The limit is less than 2 gives error “Options Error parsing installonly_limit = 1 out of range integer value”. It should be set to minimum 2 to keep the running kernel if new kernel fails due to some reason, the system can boot with the old kernel.
 
Done!!! The above settings/configurations maintain number of kernel available on CentOS 7.

No comments:

Post a Comment