How to enable automatic updates in Fedora

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,490
Reaction score
3,224
Credits
31,265
If you've been running fedora for a while, you will notice packages get updated frequently.
If you run a "dnf update" every single night, you will likely notice at least 3 or 4 packages got updated.
The kernel gets updated about once a week, it's very rare that the kernel goes 2 or 3 weeks without being updated.
Drivers and security patches and new versions of software happen more frequently.
So, to automate this, install the following.

sudo dnf install python3-dnf-plugin-rpmconf
sudo dnf install dnf-automatic
sudo systemctl enable --now dnf-automatic-install.timer

sudo vi /etc/dnf/automatic.conf


This last step is where you configure everything.
It's optional to configure it at all. But you should know about three lines in this file.
For the paranoid, you can leave this file as is,

# By default this is already set to yes,

download_updates = yes

# Whether updates should be applied when they are available, by
# dnf-automatic.timer. notifyonly.timer, download.timer and
# install.timer override this setting.
apply_updates = yes

# When the system should reboot following upgrades:
# never = don't reboot after upgrades
# when-changed = reboot after any changes
# when-needed = reboot when necessary to apply changes
reboot = when-needed

By default the "apply_updates" is set to no. This will download the updates, but it won't install them.

Also by default, the "reboot" is set to never. Even if you tell the system to apply the updates, some of them won't take effect until the
system is rebooted.

By default this runs every 24 hours. The timing is controlled in a different file.

/usr/lib/systemd/system/dnf-automatic-download.timer

You can adjust this as necessary.

=================================================================

There are two prevailing philosophies in Linux. If it ain't broke, don't fix it.
Some people never update their systems after the initial install. It works good enough for them.

The second is the opposite of the first.
Update everything as soon as possible to the latest version. This is more the fedora way.
Get those new drivers, new kernels, and security fixes out there fairly quickly.
It's not enforced, and you never have to update if you don't want to. But typically, after 1 year
a given version of fedora is no longer supported. There is no "LTS" version of fedora.

On the flip side, all versions of Redhat/CentOS, Oracle, Rocky, AlmaLinux are all based on Fedora.
They run more more thoroughly tested and older versions of the Linux kernel and various Linux packages.
In a way, you could consider these the "LTS" version of fedora. Redhat 8 for example is based
on Fedora 28. Redhat 9 is based on Fedora 34. Redhat 7 was Fedora 19.

https://docs.fedoraproject.org/en-US/quick-docs/fedora-and-red-hat-enterprise-linux/

The kernel of these is usually updated about every 3 or 4 months. But there is a difference.

A kernel is usually divided into three numbers. For example, mine looks like this.
In fact most software packages follow this convention.

6.9.9

The first number is the major version, the second number is the minor version, and the last number is the revision.
In Redhat and the other LTS versions, the major and minor numbers never change for a specific version. But the revision will change.

For example a kernel might go from 5.10.84 to 5.10.210. Notice only the revision changed, not the major and minor versions.
But fedora is different, it can go from 5.9.1 to 6.7.2 all in one release, or for fedora 40 it can go from 6.7.3 to 6.9.9

The opposite of LTS ( Long Term Support ) is "rolling release". fedora is considered a "rolling release" distro.

But even if you run an LTS version of Linux, eventually you have to update.

Edit: This should work on all Fedora clones as well, Nobara, NST, UltraMarine, etc...
 
Last edited:


Members online


Latest posts

Top