I know that in CentOS 6.x, you can put the following line in /etc/yum.conf which tells yum to keep the last N kernels (by default this is set to five):


However, there are cases when using experimental kernels (such as from ELRepo) where I want to keep a specific kernel around even if there have been 5+ updates to that kernel's package.

Are there edits to be made to /boot/grub/grub.conf or are there configuration options for yum (or dracut) to do this?

  • 1
    yum will never select to remove the running kernel. – Michael Hampton Dec 13 '14 at 17:58

You need to have yum version 3.2.26 or above and if you don't have it install yum-utils package which comes with the yumdb script. Using yumdb you can set a certain package to be kept from being removed on updates.

yum update yum
yum install yum-utils
yumdb set installonly keep kernel-2.6.32-279.2.1.el6.x86_64

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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