Ask Your Question

DNF only finds updates on the second run.

asked 2019-02-15 12:14:06 -0500

vmercuri gravatar image

This is a weird behavior that is happening basically everytime I launch dnf update, which is once every few days. On the first run, it just says dependencies are resolved and there's nothing to do. Just a few seconds later it does find updates. Anybody has any clue as to why this is happening? Screenshot here.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-02-16 14:07:32 -0500

villykruse gravatar image

That is what --refresh is for

dnf update --refresh


dnf upgrade --refresh

To check for updates without actually upgrading

dnf check-update --refresh
edit flag offensive delete link more


Hi, thank you. Let's say I'm a new user, how do I know I need to do a --refresh if it doesn't find any update on the first run? Please I need you to read my answer to @florian. Your commands do work, but I've only run the second dnf update after a few seconds (see my screenshot in the question), how come that it refreshes metadata automatically only then without me adding any --refresh option?

vmercuri gravatar imagevmercuri ( 2019-02-18 08:00:00 -0500 )edit

To know the exact details of how this works, I would need to read the source codes.

villykruse gravatar imagevillykruse ( 2019-02-19 02:05:19 -0500 )edit

@vmercuri Good question, you shouldn't have to run dnf update in order to receive your updates. Generally speaking, the configuration file of your repositories (in /etc/yum.repos.d/) define when it's time to refresh metadata. For example, take a look at any .repo file /etc/yum.repos.d/, you will see a line like


Meaning: if the metadata stored on your computer is older than 6 hours, dnf will refresh metadata and then determine if there are updates.

Please post /etc/yum.repos.d/fedora-updates.repoto

florian gravatar imageflorian ( 2019-02-20 15:05:11 -0500 )edit

A fix for Bug 1648274 - dnf fails to refresh expired metadata just came in this morning.

villykruse gravatar imagevillykruse ( 2019-02-21 01:36:30 -0500 )edit

Hi, thank you for your replies. @florian I had already changed the *.repo files and the dnf.conf by disabling the gpgcheck (just to reduce some overhead because dnf is running so slowly on my machine) and setting metadata_expire to 1s ( Maybe it's overkill, but I wanted dnf to update metadata at each run, and now it works. @villykruse that's great!

vmercuri gravatar imagevmercuri ( 2019-02-21 10:51:23 -0500 )edit

answered 2019-02-16 16:37:18 -0500

florian gravatar image

The reason is that your metadata has not yet been refreshed. On your screenshot, you see that they are 1day and 3hours old when you ran dnf update first.

edit flag offensive delete link more


Thanks. I wonder why am I supposed to run that command twice anyway? Shouldn't dnf detect new updates once I run it? What causes the second run to refresh metadata? I've also found this post from another user who basically had the same issue, except I don't have any dnfdragora daemon running in the background.

vmercuri gravatar imagevmercuri ( 2019-02-18 07:54:23 -0500 )edit

Do you have dnf-makecache.timer active?

systemctl status dnf-makecache.timer
villykruse gravatar imagevillykruse ( 2019-02-19 02:06:45 -0500 )edit

Thanks. Yes, I do:

dnf-makecache.timer - dnf makecache --timer
   Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Thu 2019-02-21 17:28:10 CET; 26min ago
  Trigger: Thu 2019-02-21 18:38:31 CET; 43min left

Feb 21 17:28:10 fedora systemd[1]: Started dnf makecache --timer.
vmercuri gravatar imagevmercuri ( 2019-02-21 10:56:10 -0500 )edit

Question Tools

1 follower


Asked: 2019-02-15 12:14:06 -0500

Seen: 112 times

Last updated: Feb 16 '19