Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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
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 '14 at 16:56

Your Answer


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.