How to use yum-cron to automatically update RHEL/CentOS Linux

‮www‬.lautturi.com
How to use yum-cron to automatically update RHEL/CentOS Linux

The yum-cron package provides a utility that can be used to automatically update a Red Hat Enterprise Linux (RHEL) or CentOS system using the "yum" package manager. To use yum-cron to automatically update your system, follow these steps:

  1. Make sure the yum-cron package is installed on your system. You can install it using the following command:
sudo yum install yum-cron
  1. Edit the yum-cron configuration file to specify your update preferences. The configuration file is located at /etc/yum/yum-cron.conf. You can use a text editor like vi or nano to edit the file.

  2. In the yum-cron configuration file, you can set the following options:

  • update_cmd: Specifies whether to check for updates (default is "security"), download updates ("download"), or install updates ("apply").
  • update_messages: Specifies whether to send update notifications to the system administrator (default is "yes").
  • download_updates: Specifies whether to download updates automatically (default is "yes").
  • apply_updates: Specifies whether to install updates automatically (default is "no").
  1. Enable and start the yum-cron service using the following commands:
sudo systemctl enable yum-cron
sudo systemctl start yum-cron
  1. The yum-cron service will now check for updates on a regular basis and apply them according to your configuration. You can check the status of the service using the following command:
sudo systemctl status yum-cron

Keep in mind that it's important to keep your system up to date to ensure that it is secure and stable. However, it's also important to carefully review any updates before installing them to ensure that they will not cause any problems with your system. Using yum-cron can help automate the update process, but it's still a good idea to periodically check for and review updates manually.

Created Time:2017-10-29 22:08:41  Author:lautturi