CentOS 7 automatic updates with yum-cron
yum-cron is an optional package that can be configured to automatically apply updates. It runs from cron and is gated (enabled/disabled) by a systemd service. Both a daily and an hourly configuration is setup in cron.
The default configuration will not apply the updates. The following changes are made:
- enable updates to be applied
Install the package
Install the rpm package (the service is enabled, but not started by default):
# yum install yum-cron # systemctl start yum-cron
Reconfigure
Reconfigure the daily cron task to apply updates:
# sed -ie 's/apply_updates = no/apply_updates = yes/' /etc/yum/yum-cron.conf
Links
- https://thecruskit.com/automatically-applying-patches-to-centos-7/
- http://linuxaria.com/howto/enabling-automatic-updates-in-centos-7-and-rhel-7
Appendices
Default configuration
The defaults in '/etc/yum/yum-cron.conf':
[commands] update_cmd = default update_messages = yes download_updates = yes apply_updates = no random_sleep = 360 [emitters] system_name = None emit_via = stdio ouput_width = 80 [email] email_from = root@localhost email_to = root email_host = localhost [groups] group_list = None group_package_types = mandatory, default [base] debuglevel = -2 mdpolicy = group:main