Apply Updates Automatically With dnf-automatic In RHEL, AlmaLinux, And Rocky Linux
DNF Automatic tool is used to check and download package updates automatically and regularly. It checks for updates available, and then performs the automatic updates.
How To Apply Updates Automatically With dnf-automatic In RHEL, AlmaLinux, And Rocky Linux [2024]
Install dnf-automatic
dnf-automatic is available in the default repositories of RHEL and its derivatives. Run the following command to install the dnf-automatic
package:
# dnf install dnf-automatic
Run the following command to verify the installation:
# rpm -qi dnf-automatic
How To Enable DNF Automatic
Modify the /etc/dnf/automatic.conf
configuration file:
To select, enable, and start a systemd timer unit that downloads available updates:
# systemctl enable dnf-automatic-download.timer
# systemctl start dnf-automatic-download.timer
To select, enable, and start a systemd timer unit that downloads and installs available updates:
# systemctl enable dnf-automatic-install.timer
# systemctl start dnf-automatic-install.timer
To select, enable, and start a systemd timer unit that reports available updates, use:
# systemctl enable dnf-automatic-notifyonly.timer
# systemctl start dnf-automatic-notifyonly.timer
To select, enable, and start a systemd timer unit that <downloads, downloads and installs, or reports available updates, use:
# systemctl enable dnf-automatic.timer
# systemctl start dnf-automatic.timer
How To Apply Updates Automatically with dnf-automatic
Now run the following command. The following command will enable the timer unit.
sudo systemctl enable --now dnf-automatic.timer
Now the updates are downloaded and installed (if enabled) automatically when they are available.
At last run the following command to verify that the timer is enabled:
# systemctl status <systemd timer unit>