I have a fairly sophisticated upgrade script, which runs the following in sequence:
dnf --assumeyes --refresh check-update
dnf --assumeyes upgrade --downloadonly
# some arbitrary commands here
dnf --assumeyes --cacheonly upgrade
dnf --cacheonly needs-restarting
All works with the exception of the last command, which complains with the following output (exit code 1):
Updating and loading repositories:
Cache-only enabled but no cache for repository “updates”
The reason I introduced “–cacheonly“ for “needs-restarting“ was that I have a server, which is offline starting from the 3rd command.
With DNF5’s introduction to refresh the repositories despite already being updated recently (same script moments ago) unnecessarily extends the downtime from a mere few minutes to 15-30 minutes extra until all attempted servers timed out repeatedly.
Asking some AI tool I was told to also include dnf --refresh makecache, but running this for tests bare on the command line did not help anything either (same error).
Is this a bug in the “needs-restarting“ plugin/command of DNF5 (e.g. does it somehow not read the refreshed repositories)?