6

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?

Sandra
  • 10,303
  • 38
  • 112
  • 165
  • 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 02 '12 at 00:41

2 Answers2

13

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.

Cristian Ciupitu
  • 6,396
  • 2
  • 42
  • 56
mailq
  • 17,023
  • 2
  • 37
  • 69
  • You actually want to set installonly_limit to some number *higher* than 3, but this is obviously a good starting point. :) – jgoldschrafe Oct 02 '12 at 01:03
  • 1
    @Sandra: Beware, your `/boot` is probably a fairly small partition. You will be sad if you fill it with superannuated kernels. – Warren Young Oct 02 '12 at 19:12
0

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.

Cristian Ciupitu
  • 6,396
  • 2
  • 42
  • 56
CDSU
  • 11
  • 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 '14 at 16:56