To enable automatic updates for Red Hat Enterprise Linux (RHEL) or CentOS 8, follow these steps:
yum-cron
package using the package manager:sudo yum install yum-cron
yum-cron
service:sudo systemctl enable yum-cron sudo systemctl start yum-cron
The yum-cron
service reads its configuration from the file /etc/yum/yum-cron.conf
. To configure the behavior of the automatic updates, you can edit this file.
By default, yum-cron
is configured to check for updates every night at 2:00 AM and to download and install any available updates. To change the frequency of the update checks, you can edit the update_cmd
option in the [commands]
section of the configuration file.
For example, to check for updates every hour, you can set the update_cmd
option to hourly
. To check for updates every day at noon, you can set the update_cmd
option to daily
.
apply_updates
option in the [commands]
section to yes
.For example:
[commands] apply_updates = yes
yum-cron
service to apply the changes:sudo systemctl restart yum-cron
Automatic updates should now be enabled and configured according to your settings.