Dnf5: everytime `Updating and loading repositories: Repositories loaded.`

With every command of dnf5 it loads and updates repositories and displays the text as follows:

$ dnf search feh
Updating and loading repositories:
Repositories loaded.
Matched fields: name (exact)
 feh.x86_64: Fast command line image viewer using Imlib2

How can I stop this extra text from displaying and the repositories should be updated only once daily.

Use dnf -q search blah

Note the -q option doesn’t work for everything there is a bug filed, Option -q (--quiet) does not work · Issue #570 · rpm-software-management/dnf5 · GitHub

1 Like

The dnf commands acessing repo metadata will check with every such command if metadata refresh is needed, according to the metadata_expire variable in the specific repo’s config files (located in /etc/yum.repos.d/). Some have a 6h refresh interval, others more.

The second line from your output shows that a check was made whether repositories needed to be updated, and the third line shows that such an update didn’t take place, as otherwise the progress and details of such repo metadata download would be presented.

In the followinw, if I change the value of metadata_expire for fedora-updates.repo and fedora-updates-testing.repo to 7d, will I still get the message?

$ grep 'metadata_expire' *.repo
fedora-cisco-openh264.repo:metadata_expire=14d
fedora-cisco-openh264.repo:metadata_expire=14d
fedora-cisco-openh264.repo:metadata_expire=14d
fedora-updates-testing.repo:metadata_expire=6h
fedora-updates-testing.repo:metadata_expire=6h
fedora-updates-testing.repo:metadata_expire=6h
fedora-updates.repo:metadata_expire=6h
fedora-updates.repo:metadata_expire=6h
fedora-updates.repo:metadata_expire=6h
fedora.repo:metadata_expire=7d
fedora.repo:metadata_expire=7d
fedora.repo:metadata_expire=7d
rpmfusion-free.repo:metadata_expire=14d
rpmfusion-free.repo:metadata_expire=7d
rpmfusion-free.repo:metadata_expire=7d
rpmfusion-nonfree.repo:metadata_expire=14d
rpmfusion-nonfree.repo:metadata_expire=7d
rpmfusion-nonfree.repo:metadata_expire=7d

Yes you would.

The only difference will be that it will show the repo list being updated or not, based on the previous metadata refresh:

$ dnf search feh --refresh # Here forcing a refresh to demo repo metadata update
Updating and loading repositories:
 Fedora 41 - aarch64 - Updates                                                                   100% |  38.6 KiB/s |  19.1 KiB |  00m00s
 RPM Fusion for Fedora 41 - Free - Updates                                                       100% |  20.1 KiB/s |   7.4 KiB |  00m00s
 RPM Fusion for Fedora 41 - Nonfree - Updates                                                    100% |  19.0 KiB/s |   7.4 KiB |  00m00s
 Fedora 41 - aarch64                                                                             100% | 182.2 KiB/s |  21.0 KiB |  00m00s
 RPM Fusion for Fedora 41 - Free                                                                 100% |  21.3 KiB/s |   7.9 KiB |  00m00s
 Fedora 41 openh264 (From Cisco) - aarch64                                                       100% |   7.5 KiB/s | 990.0   B |  00m00s
 RPM Fusion for Fedora 41 - Nonfree                                                              100% |  23.1 KiB/s |   8.0 KiB |  00m00s
 Fedora 41 - aarch64 - Updates                                                                   100% |   2.7 MiB/s |   1.7 MiB |  00m01s
 RPM Fusion for Fedora 41 - Free - Updates                                                       100% |  60.9 KiB/s |  41.7 KiB |  00m01s
 RPM Fusion for Fedora 41 - Nonfree - Updates                                                    100% |  20.8 KiB/s |  24.2 KiB |  00m01s
 Fedora 41 - aarch64                                                                             100% | 900.4 KiB/s | 470.9 KiB |  00m01s
Repositories loaded.
Matched fields: name (exact)
 feh.aarch64: Fast command line image viewer using Imlib2
Matched fields: name
 golang-github-google-safehtml-devel.noarch: Safe HTML for Go
 perl-IPC-Run-SafeHandles.noarch: Use IPC::Run and IPC::Run3 safely
 sdorfehs.aarch64: A tiling window manager
 
 
$ dnf search feh # When repo metadata is up to date
Updating and loading repositories:
Repositories loaded.
Matched fields: name (exact)
 feh.aarch64: Fast command line image viewer using Imlib2
Matched fields: name
 golang-github-google-safehtml-devel.noarch: Safe HTML for Go
 perl-IPC-Run-SafeHandles.noarch: Use IPC::Run and IPC::Run3 safely
 sdorfehs.aarch64: A tiling window manager