Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I yum update it wants to remove the oldest of the 3 kernel I have and upgrade to a new.

Is it possible to get yum not to remove old kernels?

share|improve this question
    
I haven't seen such behaviour tbh. In my opinion, yum is intelligent enough not to do this. Can you show the yum update command output that is asking to remove the old kernel. A quick hack would to be to download the new rpm of kernel and install that using rpm -ivh but I also don't want to do that since yum is a reliable enough tool. –  Soham Chakraborty Oct 2 '12 at 0:41
add comment

2 Answers

up vote 5 down vote accepted

In /etc/yum.conf set installonly_limit=3. Quoting from the documentation:

installonly_limit Number of packages listed in installonlypkgs to keep installed at the same time. Setting to 0 disables this feature. Default is ’0’. Note that this functionality used to be in the "installonly" plugin, where this option was altered via. tokeep. Note that as of version 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If that attribute is "keep", then they will never be removed.

share|improve this answer
    
Cool, good to know this. –  Soham Chakraborty Oct 2 '12 at 0:50
    
You actually want to set installonly_limit to some number higher than 3, but this is obviously a good starting point. :) –  jgoldschrafe Oct 2 '12 at 1:03
    
@Sandra: Beware, your /boot is probably a fairly small partition. You will be sad if you fill it with superannuated kernels. –  Warren Young Oct 2 '12 at 19:12
add comment

The installonly_limit parameter (from /etc/yum.conf) can be increased to 10 or 100 instead of 3. This will allow more kernel versions to be kept.

share|improve this answer
1  
Yes, but you will need a lot of space in /boot if you start storing lots of kernels. Typically 3 is more than sufficient. –  Michael Hampton May 25 at 16:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.