-
-
Save Aldaviva/9db64e47324f467a7c9b7e468a454c76 to your computer and use it in GitHub Desktop.
-
Install plugin
sudo apt install unattended-upgrades
-
Edit package behavior
Create a new configuration override file and set its contents to the following, changing values to your liking.
sudo $EDITOR /etc/apt/apt.conf.d/51unattended-upgrades-local
Unattended-Upgrade::Origins-Pattern { "origin=*"; }; Unattended-Upgrade::Automatic-Reboot "false";
This will upgrade all packages, regardless of which repository they come from. It won't reboot after installing upgrades.
See Debian Reference § 2.7.3: Automatic download and upgrade of packages, /etc/apt/apt.conf.d/50unattended-upgrades
and /usr/share/doc/unattended-upgrades/README.md.gz
for documentation, defaults, and examples.
- Install plugin
sudo dnf install dnf5-plugin-automatic
- Edit plugin behavior
sudo cp /usr/share/dnf5/dnf5-plugins/automatic.conf /etc/dnf/automatic.conf sudo $EDITOR /etc/dnf/automatic.conf
commands.apply_updates
can be set toyes
to actually install the updates instead of only downloading them - Edit timer
For example, to make DNF install updates at exactly 1:05 AM every day, you can set the file contents to
sudo systemctl edit dnf5-automatic.timer
more systemd timer examples[Timer] # Empty string disables the default 6-7 AM update OnCalendar= OnCalendar=*-*-* 1:05 RandomizedDelaySec=0
- Enable timer
sudo systemctl enable --now dnf5-automatic.timer
- Verify timer status
systemctl status dnf5-automatic.timer systemctl list-timers --all dnf5-automatic
Interesting! Yes if you need it to reboot at a specific time, and prefer to have your files pre-populated with configs then that totally makes sense. I prefer an empty config file and to build up.
I'm pretty sure the config format didn't change between dnf5-automatic and dnf-automatic, though? Can't find any reference to them changing online. Edit: wait I see what you mean! The config format hasn't changed, but the pre-configured automatic timers have been removed from dnf5-automatic plugin!! https://dnf5.readthedocs.io/en/latest/changes_from_dnf4.7.html#changes-to-individual-commands. I'll update the Fedora docs to reflect this.
Thank you @nikodunk. Yes, some of the steps I have are optional and only necessary if you want to fine-tune certain aspects of the updates. Otherwise, please correct me if I've missed your point.
Overall I found this particular section of the Fedora documentation lacking because it was never updated for the new
dnf5-automatic
plugin that was introduced with DNF5 in Fedora 41, which is configured differently enough from the older DNF4 variantdnf-automatic
that the documentation covers. I have used both plugins, and had to re-learn how to configure the new one based on looking at the configuration and timer files on disk.