1

I'm using Fedora and wonder if there is some way I can exclude kernel updates when I run yum update, until I specifically want to update the kernel.

The reason why I am concerned about this is because sometimes it requires a lot of extra research finding patches for some programs and extra time spent recompiling them to work on the new kernel. I am thinking VMWare specifically as one example.

I wonder if there is some way for yum update to NOT update the kernel and only notify me that a new one is available when it goes through its routine so that I can decide to put it off until a more convenient time. Or is this thinking likely to cause other issues?

8

Try this:

yum --exclude=kernel\* update

or:

yum -x 'kernel*' update

From yum man page:

-x, --exclude=package
        Exclude a specific package by name or glob from updates on all
        repositories. Configuration Option: exclude

And if you want to make this persistence, add a line exclude=kernel* to /etc/yum.conf:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://b
distroverpkg=centos-release
exclude=kernel*

When you want to update,use --disableexcludes option to override config in yum.conf:

yum --disableexcludes=main update
5
  • I believe you can also put exclude=kernel* in /etc/yum.conf if you don't want to remember the option every time or alias it. May 8 '14 at 17:11
  • @Livinglifeback: Yeap, I was updating my answer when you commented.
    – cuonglm
    May 8 '14 at 17:14
  • Okay the persistant solution is what I was looking for. It works, but let's say I now think its time to update the kernel. yum update kernel* won't work unless I remove the exclude from yum.conf. Is there an easy way to override it when I want to?
    – Octopus
    May 8 '14 at 17:53
  • @Octopus: Updated my answer!
    – cuonglm
    May 8 '14 at 17:56
  • Applied the same configuration to my dnf.conf on Fedora. I'm curious, will I get a new kernel update when I will upgrade to the next Fedora major release? May 24 '20 at 20:25

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.