How can I exclude a package from yum-cron but not from manual "yum upgrade"?

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?


Solution 1:

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.

Solution 2:

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 :

[base]
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.