I've just gone through my servers and installed yum-cron (and then enabled with chkconfig yum-cron on since that doesn't seem to happen automatically).

Now I realise that I'm running a MongoDB cluster and that automatically upgrading the mongo-server packages could break and/or corrupt data.

I have considered adding exclude=mongo* to my yum.conf file to skip all mongo upgrades, but I would love to still be able to run yum upgrade manually and get all packages updated.

Is there a neat way of achieving this?


In /etc/sysconfig/yum-cron, there is an option called YUM_PARAMETER= which you can use to pass yum parameters to. For example:

YUM_PARAMETER="-x mongo*" 

The scope of that parameter seems to be limited to the yum-cron package.


The previous Jason answer is working for centos 6.x.

For centos 7 and yum-cron package, the config file is /etc/yum/yum-cron.conf. If you wish to exclude some packages from auto-update mechanism, you'll have to add an exclude line, at the bottom of the file, in the base section.

Example :

exclude = kernel* owncloud* php* httpd*

This will override the yum.conf options, but only in the yum-cron context, which is the goal of this thread.

  • Nice man, +1 exactly what I was looking for, I confirm it works in centOS7 – lese Aug 3 '17 at 9:38

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.