• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : Configure yum automatic updates with yum-cron service

By admin

yum-cron is an optional package starting from Red Hat Enterprise Linux 6, this is a plugin for yum. From man page of yum-cron :

yum-cron is a simple way to call yum commands from cron. It provides configuration to keep repository metadata up to date, and to check for, download, and apply updates.

The yum-cron package provides a convenient way to check for, download and apply updates automatically. The cron jobs from the yum-cron package are active immediately after installing the package and there’s no extra configuration necessary. The job will be run when your normal daily cron jobs are set to run.

Installation

To install yum-cron package

# yum -y install yum-cron
# chkconfig yum-cron on

Configuration for RHEL 6

Then edit /etc/sysconfig/yum-cron to set MAILTO=[email address] for email notifications.

MAILTO=sys@example.com

To exclude packages using yum-cron edit the /etc/sysconfig/yum-cron to have the packeges to be excluded in the automatic uodate :

YUM_PARAMETER=kernel* mysql*

To start yum-cron service after editing configuration file.

# service yum-cron start

Configuration for RHEL 7

Then edit /etc/yum/yum-cron.conf to set email_to=[email address] for email notifications.

email_to=sys@example.com

To exclude packages using yum-cron edit the /etc/yum/yum-cron.conf to have the packeges to be excluded in the automatic uodate :

exclude=kernel* mysql*

In RHEL 7 you can use following options in yum-cron configuration file, to install security updates.

[commands]
#  What kind of update to use:
# default                            = yum upgrade
# security                           = yum --security upgrade
# security-severity:Critical         = yum --sec-severity=Critical upgrade
# minimal                            = yum --bugfix upgrade-minimal
# minimal-security                   = yum --security upgrade-minimal
# minimal-security-severity:Critical =  --sec-severity=Critical upgrade-minimal
update_cmd = default

To start yum-cron service after editing configuration file.

# systemctl start yum-cron

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to make CentOS/RHEL 7 FIPS 140-2 compliant
  2. How to Configure Interface bonding (NIC Teaming) on Oracle Linux 6
  3. How To Identify User Deleting Files From A Given Directory in Linux
  4. CentOS / RHEL : Beginners guide to vsftpd (installation and configuration)
  5. How to change the default location (/var/cache/yum) of yum cache
  6. How to interpret Linux martian source messages
  7. Basic vi commands (cheat sheet)
  8. How to use compress, zip, gzip commands under Linux
  9. How to Change the Default Timeout Settings for Telnet Session in CentOS/RHEL
  10. Audit Log And Messages File Not Rotating on CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary