How to Set up Software Updates Automatically on Oracle Linux

Regardless of whether you use ULN or an Oracle Linux yum server, software updates are achieved using standard dnf commands on the system and depend on the system having the appropriate ULN channel subscriptions or yum repositories enabled.

You can use the dnf install and dnf update commands to handle general package installation or updates.

To update a system to use the latest packages that are available, run:

sudo dnf upgrade

Note:

The dnf update command automatically runs dnf upgrade.

Update the system often to ensure that packages have the latest security patches and bug fixes. Consider using automatic updates so that software is correctly maintained on the system.

Note than if you use the dnf install command for software that’s already installed, the software packages that you specify are also updated to the latest available version.

Updating Software Automatically

The DNF Automatic tool is provided as an extra package that you can use to keep the system automatically updated with the latest security patches and bug fixes. The tool can provide notifications of updates, download updates, and then install them automatically by using systemd timers.

You can install the dnf-automatic package and enable the systemd dnf-automatic.timer timer unit to start using this service:

sudo dnf install -y dnf-automatic

sudo systemctl enable --now dnf-automatic.timer

You configure the DNF Automatic tool by editing the /etc/dnf/automatic.conf configuration file and then restarting the timer unit.

Note that other timer units are available and can override the default configuration that’s specified in the configuration file. Often, these timer units are used as handy shortcuts to perform a specific behavior:

  • dnf-automatic-notifyonly.timer: Notifies for available updates
  • dnf-automatic-download.timer: Downloads package updates, but doesn’t install them
  • dnf-automatic-install.timer: Downloads and automatically installs package updates

You enable the required behavior by running:

sudo systemctl enable --now dnf-automatic-install.timer

See the dnf-automatic(8) manual page for more information.

Important:

By using Oracle Ksplice, you can keep an Oracle Linux kernel patched and updated all the time, without any need to reboot. For Oracle Linux Support customers, Ksplice is an essential tool to keep the systems safe, secure, and updated. See Oracle Linux: Ksplice User’s Guide for more information.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Anohter solution

sudo vim /etc/dnf/automatic.conf

Change “apply_updates” from no to yes