8

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?

7

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.

3
  • Thanks - and found some more at samdoran.com/2013/05/17/… Jan 15 '14 at 8:49
  • Hello, /etc/sysconfig/yum-cron doesn't exist in CentOS7+, but you can directly use exclude=mongo in /etc/yum/yum-cron.conf. Aug 16 at 19:46
  • What I'm trying to find is, how can I pass --skip-broken to yum-cron, any ideas? Aug 16 at 19:50
20

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.

1
  • 1
    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.