Yum-cron is a package that can be used to automatically update packages on RHEL/CentOS Linux systems. Here are the steps to set up yum-cron:
- Install yum-cron:
sudo yum install yum-cron
- Edit the configuration file for yum-cron:
sudo vi /etc/yum/yum-cron.conf
The configuration file has several options that can be used to customize the behavior of yum-cron. Some of the most important options are:
update_cmd
: This option specifies the command that yum-cron will use to perform updates. The default value isdefault
, which means that yum-cron will use the same command that is used by theyum update
command. Other options includesecurity
(which only updates packages that have security updates), andnone
(which disables updates).download_updates
: This option controls whether or not yum-cron will download updates before installing them. The default value isyes
, which means that updates will be downloaded before they are installed.apply_updates
: This option controls whether or not yum-cron will apply updates automatically. The default value isno
, which means that updates will not be applied automatically.
- Start and enable the yum-cron service:
sudo systemctl start yum-cron
sudo systemctl enable yum-cron
This will start the yum-cron service and configure it to start automatically at boot.
Once yum-cron is set up, it will automatically download and install updates according to the configuration file. By default, yum-cron will check for updates every day, but you can customize the schedule by editing the /etc/cron.daily/0yum-daily.cron
file. You can also view the yum-cron log file at /var/log/yum.log
to see which packages were updated and when.