Optimize Fedora DNF Performance with Metadata and Mirror Caching – Complete Guide
Learn how to speed up DNF on Fedora by using metadata caching, preloading repositories, and the fastestmirror plugin for faster package installations.
Optimize DNF on Fedora with metadata caching and fast mirrors for quicker software installs.
These Fedora DNF tips save bandwidth, reduce delays, and make repeated installs faster and reliable.
Finally, this Guide is Valid also for All the others Fedora Based Distros like:
- Nobara
- Quebe OS
- Ultramarine
- risiOS

1. Enable metadata caching
By default, DNF refreshes repository metadata every time it runs. To speed it up, set metadata expiration in /etc/dnf/dnf.conf:
sudo nano /etc/dnf/dnf.conf
Add under [main]:metadata_expire=7d
Finally, Ctrl+x to Save & Exit from nano Editor.This keeps repository metadata for 7 days, reducing repeated downloads and accelerating updates.
2. Preload repository metadata with makecache
The dnf makecache command downloads and stores repository metadata locally, so subsequent dnf commands run faster:
sudo dnf makecache
This is particularly useful after adding new repositories or before running bulk installs.
3. Enable the fastestmirror plugin
The fastestmirror plugin caches information about the fastest repository mirrors, reducing lookup time:
sudo dnf install dnf-plugins-core
sudo dnf config-manager --set-enabled fastestmirror
After this, dnf will automatically pick the quickest mirror for downloads.
For repeated installations, combining metadata caching with makecache and fastest mirror selection provides the best performance.