


How to use `yum-cron` for automatic updates yum dnf
Sep 13, 2025 am 03:09 AM Automatic update of system patches and software packages is an important part of maintaining the security of Linux servers. If you are using a RHEL-based system, such as CentOS or Rocky Linux, yum-cron
is a simple and effective tool to achieve this goal.
Below are some practical suggestions to help you use yum-cron
to complete the automatic update task.
Configuration file location and basic settings
The configuration files for yum-cron
are usually located in /etc/yum/yum-cron.conf
and /etc/yum/yum-cron-hourly.conf
(if you enable hourly checks). The former is used for daily daily update tasks, while the latter is used for more frequent checks.
The main configuration items include:
-
update_cmd
: Specify the update method, which can bedefault
,security
, orminimal
, etc. -
update_packages
: Optional, specifying that only certain specific packages are updated -
download_updates
andapply_updates
: Controls whether to automatically download and install updates -
system_name
: Set the host name to display when mail notifications
Remember to restart the service after modifying the configuration:
sudo systemctl restart yum-cron
Enable and run the yum-cron service
In most modern systems, yum-cron
runs as a systemd service. You can enable and start it with the following command:
Enable Power-on:
sudo systemctl enable yum-cron
Start the service:
sudo systemctl start yum-cron
If you want the system to check for updates more actively, you can enable yum-cron-hourly
service:
sudo systemctl enable yum-cron-hourly sudo systemctl start yum-cron-hourly
Note: These two services may run at the same time. It is recommended to choose one according to your needs to avoid repeated operations.
Compatibility issues under DNF system
Starting from RHEL 8, the default package manager has been replaced with dnf
, but yum-cron
has actually been transformed into a version that uses dnf
command. That is to say, in newer systems you can still use yum-cron
, which calls dnf
behind it.
But be aware of:
- The installation package name may be different, for example, in some distributions it is
dnf-automatic
- The configuration file path may be slightly different, and some systems will place the configuration in the
/etc/dnf/
directory - If you encounter compatibility issues, you can consider using
dnf-automatic
directly as a substitute
Log viewing and email notification settings
To ensure that the update is going on properly, you should check the logs regularly. By default, yum-cron
will write output to the system's log, usually /var/log/messages
or viewed through journalctl
:
journalctl -u yum-cron
If you want to receive email notifications, you can set it in the configuration file:
-
email_to
: email address to receive notifications -
email_from
: sender address -
emit_via
: Selectemail
orstdio
to decide whether to send it via email
In addition, make sure that the system has available mail transfer agents (such as sendmail
or ssmtp
) configured.
Basically that's it. As long as the configuration is properly, yum-cron
can silently ensure the system security without disturbing you. The key is to check the log regularly to confirm that there are no omissions or failures.
The above is the detailed content of How to use `yum-cron` for automatic updates yum dnf. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

ArtGPT
AI image generator for creative art from text prompts.

Stock Market GPT
AI powered investment research for smarter decisions

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

When you connect any new hardware device to the system, Windows will automatically try to install the driver for it. When the system's built-in driver package cannot be recognized, it will automatically try to connect to Windows Update to search and install the driver. Windows can also automatically update device drivers through Windows Update without user interaction. Although this function seems convenient, under certain circumstances, the feature of automatically updating drivers can cause trouble for users. For example, users' video workflows such as DaVinciResolve, Adobe Premiere, etc. need to use a specific old version of Nvidia Studio driver. As a result, Windows

Turn off method: 1. Turn off updates through system settings; 2. Disable Windows Update service through Service Manager; 3. Use Group Policy rules (Professional version or higher only).

Many users always receive automatic updates from the system when using their computers on a daily basis, which not only slows down the computer but also causes it to become stuck. For this reason, today we bring you how to operate Win11 if you don’t want to automatically update. If automatic updates keep affecting you, Let’s see how to close it. How to prevent Windows 11 system from automatically updating 1. First, right-click "This PC" on the desktop and select "Manage". 2. In the opened "Computer Management", click "Services" → "Applications" → "Services" → "Windows update". 3. Next, double-click "Windows update", set the "Startup type" to "Disabled", click "Stop" service and confirm. 4. Click the "Recover" tab to restore the first lost

When using win10 system, we all often encounter update problems. This update is sometimes very annoying, so how can we solve this problem? This requires us to enter the local group policy to set it. How to turn off automatic updates in Win10 Group Policy: 1. Press "win+R" on the keyboard to open Run, enter "gpedit.msc" and click OK. 2. Select "Administrative Templates" - "Windows Components" and double-click to enter. 3. Then find "Windows Update" and double-click to enter. 4. Find "Configure automatic updates" on the right and double-click to open it. 5. Then check "Disabled" and click "Apply".

How to Develop an Auto-Updating WordPress Plugin WordPress is a very popular open source content management system (CMS) with a rich plugin market to extend its functionality. To ensure that plugins are always up to date and secure, developers need to implement automatic updates. In this article, we’ll walk you through how to develop an auto-updating WordPress plugin and provide code examples to help you get started quickly. Preparation Before starting development, you need to prepare the following key steps: Create

Today’s mobile phones are becoming more and more powerful, with more and more comprehensive functions, and also provide users with a more comfortable experience. As the latest new model released, Redmi13C also has many functions and also provides users with There are many new designs coming, so how to turn off automatic updates on Redmi 13c? Let the editor of this website briefly introduce the functions to you. If you need it, you can come and take a look. How to turn off automatic updates on Redmi 13c? 1. Open the phone settings and click My Device. 2. Click MIUI version. 3. Click on the three dots in the upper right corner. 4. Click System Update Settings. 5. Turn off the switches behind automatic downloads and smart updates. It is necessary to know about turning off automatic updates. The above is the Redmi 13

When many users use computers, sometimes a malfunction occurs and they can only operate in safe mode. However, safe mode is always updated automatically, causing unnecessary trouble. In fact, the method of shutting down is not difficult, just disable it. . How to cancel automatic updates in win10 safe mode: 1. Press the keyboard "Win+R" and enter "services.msc" in the run box and click "OK" 2. Find "Windows Update" in the pop-up service 3. Change the "Startup type" Change it to disabled and click "Apply"

How does Kirin OS provide automatic update and upgrade functions? With the continuous advancement of technology and the increasing importance of operating systems, users have increasingly higher requirements for the stability, security and functions of operating systems. In order to meet the needs of users, the operating system needs to provide automatic updates and upgrades, fix vulnerabilities and add new features in a timely manner. As a domestically developed operating system, Kirin operating system is no exception. It provides automatic update and upgrade functions. In the Kirin operating system, the automatic update and upgrade functions are mainly through the software package manager and update software.
