I updated the kernel on our servers from the CentOS default of 3.10.xxx to 4.17.xxx using the elrepo repository.

After adding the repo, I installed the kernel-m1 package. Edited /etc/default/grub to default to the top kernel (0) and rebuilt the grub config.

Everything has been working, except when yum update runs it will update the 3.10.xxx kernel if available and replaces 4.17.xxx in the boot order.

What is the correct way to deal with this issue? Should I add an exclude to the CentOS-Base repository for kernel packages?

  • What is set for GRUB_DEFAULT in /etc/default/grub? If it is set to saved then you need to look at grub2 config. Check the value in /boot/grub2/grubenv. – Tux_DEV_NULL Jul 6 '18 at 8:34
  • I set it to 0 when I installed the new kernel. The problem is when a new kernel installs whether it be 3.10.xxx or 4.17.xxx the newest install becomes 0. A possible solution I found is to exclude kernel updates in the CentOS repos, but I can't figure out which repo kernel 3.10.xxx is coming from. – dstana Jul 6 '18 at 17:19
  • Simply removing the kernel package should be sufficient. – Michael Hampton Jul 8 '18 at 13:29

Should I add an exclude to the CentOS-Base repository for kernel packages?

You may exclude=kernel. Note that exclude is a global variable, in yum.conf and not any of the repos. This works because the newer kernel package is intentionally named something different, kernel-ml ("mainline").

The yum versionlock plugin might also be used for the purpose of stopping updates to a given package.

The repo name is the 3rd piece of yum list output:

kernel.x86_64                    3.10.0-862.6.3.el7                     @updates
$ grep -F [updates] /etc/yum.repos.d/*

Remember that when you replace distro packages with third party ones, you switch maintainers. Ensure you get the security and stability updates you need.

  • I did this for security reasons. Redhat's meltdown / Spectre patches were causing lockups with cpservd. The updated kernel resolves those issues. – dstana Jul 9 '18 at 4:21

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.