We know the importance of staying on top of any security alerts and applying important updates, but it can be a tedious and time-consuming task to make sure all of the software on your CentOS system is updated, especially when you're managing more than one server. This recipe shows you how to automate the update process ensuring your system stays up to date without the need for daily interaction.
This recipe requires a CentOS system with a working network connection. Administrative privileges are also required, either by logging in with the root
account or through the use of sudo
.
To automate software updates using yum-cron
, perform the following steps:
Install the
yum-cron
package:yum install yum yum-cron
Start and enable the service:
systemctl start yum-cron systemctl enable yum-cron
Perform a system update to ensure everything is up to date before
yum-cron
takes over:yum update