Stop dnf from stalling when your mirror is a disaster

Package Management (Apt/Dnf/Pacman Internals)

Stop dnf from stalling when your mirror is a disaster

🧩 The Challenge

Dealing with a slow or flaky mirror that hangs during the metadata download stage is enough to make you want to throw your keyboard. You sit there watching the progress bar crawl, only to have the whole thing timeout after ten minutes of waiting.

💡 The Fix

Tell dnf to ignore the garbage mirrors and force a faster timeout so you can fail over to a functional server immediately. It saves you from waiting for a connection that was never going to happen.

dnf --setopt=fastestmirror=False --setopt=timeout=5 install <package_name>

⚙️ Why It Works

Setting the timeout flag forces the client to give up on unresponsive hosts way faster than the default setting, which is usually tuned for dial-up speeds. Disabling fastestmirror prevents the package manager from wasting time probing every server in the region when you already know where you want to fetch from.

🚀 Pro-Tip: Stick this in your dnf.conf file if you find yourself working on networks with high packet loss.

Linux Tips & Tricks | © ngelinux.com | 8/26/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted