In short I want to change the dnf automatic update sheduler to only run once on boot instead of checking every 3 hours or so which is the default.
What location would I need to check to edit this config? Thanks
In short I want to change the dnf automatic update sheduler to only run once on boot instead of checking every 3 hours or so which is the default.
What location would I need to check to edit this config? Thanks
How to specify the time for automated system updates (dnf-automatic)? AND/OR https://redstagtechnica.com/2019/07/dnf-automatic-schedule-updates-fedora-and-other-linux-distros/
May be of use for dnf4. I am not sure if you are using dnf (4) or dnf5, there may be differences in file location.
And for DNF5 Enable automatic updates in Fedora and Debian · GitHub
sudo EDITOR="sed -i -e /^OnUnitInactiveSec=/d" \
systemctl edit dnf5-makecache.timer -l
sudo systemctl restart dnf5-makecache.timer
Thanks that was the right pointer. It’s location is
/usr/lib/systemd/system/dnf5-makecache.timer
It’s descriptive enough to make the needed changes. I’ve uncommented OnUnitInactive line to block update search during use but allow run once on boot.
Note that systemctl edit
helps ensure that changes are applied correctly and persist across future upgrades.
As @vgaetera said it is not a good idea to edit the unit files in /usr.
The systemctl edit command is specifically designed to allow you to override only what you need to from and save your change /etc.
Then when you update the system your edit will continue to work when the files in /usr are upgraded.
Noted