11

I noticed that when I clean dnf's metadata and then run dnf upgrade to fetch new metadata and check for upgradeable packages multiple times, it tends to often download different amounts of data which sometimes result in one run not having any updates while the next run might do.

How can I fix this and always get the freshest (i.e. newest) metadata in dnf on Fedora (26)?

Screenshot of dnf after multiple runs

1 Answer 1

17

Just run dnf clean expire-cache first to make sure it validates the cache before using it or, even better, just add --refresh to your command because, as the manual page says:

    --refresh
           set metadata as expired before running the command
5
  • 1
    That's not the problem. What I do is I remove all of the cached metadata via dnf clean all before the dnf upgrade command. The problem is what it downloads as metadata differs in multiple runs of the two commands.
    – comfreak
    Aug 11, 2017 at 13:54
  • Well that shouldn't be possible - everything is checksummed and if you expire the cache it will refetch the root descriptor and then validate everything else against those checksums and refetch them if they are wrong.
    – TomH
    Aug 11, 2017 at 16:38
  • 1
    It's probably hitting different mirrors, which may not all be synced to the latest updates.
    – mattdm
    Aug 11, 2017 at 17:44
  • @mattdm That's my guess as well, but how do you fix that? Can I change it to their source directly? Or is the only option that I create my own mirror?
    – comfreak
    Aug 11, 2017 at 18:23
  • 1
    Creating your own mirror is a decent option, or you can edit the .repo files to point at a specific mirror. If you have more than one system, creating your own mirror is likely the best choice. And please don't point at the main Fedora servers, because if everyone did that we'd be overwhelmed. Find a fast, nearby mirror and use that.
    – mattdm
    Aug 11, 2017 at 18:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .