Keeping your system updated is one of the most important steps to ensure security, stability, and performance. On Rocky Linux 9.6, you can automate updates using the dnf-automatic package, which integrates seamlessly with the dnf package manager. This guide walks you through installation, configuration, and enabling automated updates.
The dnf-automatic tool is not installed by default. To add it, run:
sudo dnf install -y dnf-automaticThe main configuration file is located at:
/etc/dnf/automatic.conf
Open it with your preferred text editor:
sudo nano /etc/dnf/automatic.conf-
Upgrade type Defines what kind of updates should be applied.
[commands] upgrade_type = security
Options include:
default– all updatessecurity– only security updates
-
Apply updates automatically To enable automatic installation:
apply_updates = yes -
Email notifications (optional) You can configure
dnf-automaticto send update notifications by editing the[emitters]and[email]sections in the same file.
dnf-automatic uses systemd timers to schedule update checks.
Enable and start the automatic update timer:
sudo systemctl enable --now dnf-automatic.timerThis ensures updates are checked and applied regularly.
There are different timers depending on your needs:
-
Apply updates automatically:
sudo systemctl enable --now dnf-automatic-install.timer -
Notification only (no auto-install):
sudo systemctl enable --now dnf-automatic-notifyonly.timer
Check the status of the timer:
systemctl status dnf-automatic.timerLogs can be viewed with:
journalctl -u dnf-automaticBy configuring dnf-automatic, you ensure that your Rocky Linux 9.6 system remains up to date without manual intervention. For critical environments, you may prefer to restrict updates to security patches only; for desktops or development systems, enabling all updates might be more convenient.