Speed Up DNF on Fedora: Installing and Configuring Plugins for Faster Package Downloads

Fedora tutorial - IT technology blog
Fedora tutorial - IT technology blog

Tired of watching dnf update crawl at a snail’s pace? I’ve been there. After two years of running Fedora as my main development machine, I found a way to cut makecache time from ~45 seconds down to ~12 seconds — with just a few plugins and some simple config tweaks.

Get It Done in 5 Minutes

No need to read through everything — here are the commands to run right now:

# Install the core plugin set
sudo dnf install -y dnf-plugins-core deltarpm python3-deltarpm

# Enable fastest mirror — automatically selects the nearest server
echo "fastestmirror=True" | sudo tee -a /etc/dnf/dnf.conf

# Enable parallel downloads — download multiple files at once
echo "max_parallel_downloads=10" | sudo tee -a /etc/dnf/dnf.conf

# Enable deltarpm — only download the changed portions
echo "deltarpm=True" | sudo tee -a /etc/dnf/dnf.conf

# Refresh and test
sudo dnf clean all && sudo dnf makecache --refresh

That’s it. If you’re in a hurry, copy those 5 commands and you’re done. The rest of this article explains why each one matters.

Why Is DNF Slow by Default?

The core issue: DNF downloads packages one at a time by default. No parallelism, no automatic nearest-mirror selection — nothing special. When you’re in Hanoi and DNF is pulling files from a server in Frankfurt, of course it’s going to be slow.

On top of that, every update downloads the full package even when only a few hundred KB have changed. In short, there are 3 main problems:

  • Suboptimal mirror selection — connecting to distant servers
  • Sequential package downloads instead of parallel
  • Downloading full packages instead of just the diff

A Closer Look at Each Plugin

1. dnf-plugins-core — The Foundation Plugin Set

This package is a meta-package containing many important DNF plugins. Modern Fedora usually has it pre-installed, but running the command again doesn’t hurt:

sudo dnf install dnf-plugins-core

# Check currently installed plugins
dnf list installed | grep dnf-plugin

2. Fastest Mirror — Automatically Selects the Fastest Server

The mechanism is simple: this plugin pings all mirrors in the list and selects the one with the fastest response time from your location. Testing from Vietnam, I saw speeds 3–4x faster than the default.

sudo nano /etc/dnf/dnf.conf

Add this line to the [main] section:

[main]
fastestmirror=True

The first run will take a few extra seconds to measure mirror speeds. The results are cached, so subsequent runs are much faster.

3. Parallel Downloads — Download Multiple Packages Simultaneously

This is my favorite feature. Instead of waiting for each package to finish before downloading the next, DNF fetches multiple files simultaneously:

sudo nano /etc/dnf/dnf.conf

# Add to the [main] section
max_parallel_downloads=10

10 is the sweet spot from experience. Going up to 20+ can sometimes cause mirror servers to throttle you back. On a slow connection, 5–6 is plenty.

4. DeltaRPM — Download Only the Changed Portions

Instead of downloading an entire 50MB package on every update, deltaRPM only fetches the diff against your installed version. A 50MB package might only require a 2–3MB download for a minor update — the bandwidth savings are noticeable.

sudo dnf install deltarpm python3-deltarpm

# Enable in config
echo "deltarpm=True" | sudo tee -a /etc/dnf/dnf.conf

Note: DeltaRPM works best when you update frequently. If you leave the machine unupdated for a long time, delta files can sometimes be larger than the original package — in that case, DNF automatically falls back to downloading the full package.

Advanced Configuration

Complete /etc/dnf/dnf.conf File

Here’s the config file I use on my development machine — feel free to copy it directly:

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=False
skip_if_unavailable=True

# Speed up downloads
fastestmirror=True
max_parallel_downloads=10
deltarpm=True

# Cache settings
keepcache=False
metadata_expire=6h

# Timeout — prevent hanging on slow mirrors
timeout=30
minrate=1000

Explanation of the less-common settings:

  • metadata_expire=6h — Doesn’t check for updates continuously; once every 6 hours is enough
  • timeout=30 — If a mirror doesn’t respond within 30 seconds, skip it and try another
  • minrate=1000 — If the speed drops below 1KB/s, switch mirrors immediately
  • best=False — Allows installing a non-latest package version if there are dependency conflicts

Refresh Metadata Before Major Updates

Before each major upgrade or after changing your configuration, run this to ensure you’re using the best available mirror:

# Clear old cache and refresh
sudo dnf clean all
sudo dnf makecache --refresh

# Check which mirror is currently selected
sudo dnf repolist -v | grep Repo-baseurl

Managing Copr Repos with dnf-plugins-core

Once you have dnf-plugins-core, the dnf copr command is ready to use — enabling Copr repositories without having to manually copy URLs:

# Enable a Copr repo
sudo dnf copr enable username/reponame

# List enabled Copr repos
sudo dnf copr list

# Disable a repo you no longer use
sudo dnf copr disable username/reponame

Practical Tips from Daily Use

Tip 1: Download First, Install Later

When you have a good connection, download packages in advance and install them later when offline:

# Download all updates to cache without installing
sudo dnf upgrade --downloadonly

# Install from cache — no internet needed
sudo dnf upgrade --cacheonly

Tip 2: Disable Unnecessary Plugins

Some plugins are enabled by default and slow down dependency resolution, even if you never use them:

# View enabled plugins
ls /etc/dnf/plugins/

# Disable the copr plugin if you don't use Copr
# Edit /etc/dnf/plugins/copr.conf, add:
# enabled=0

Tip 3: Handy Terminal Aliases

Add these to ~/.bashrc or ~/.zshrc:

# Quick update with clean output
alias update='sudo dnf upgrade -y --refresh'

# Clean up after updates
alias cleanup='sudo dnf autoremove -y && sudo dnf clean packages'

# Apply immediately without opening a new terminal
source ~/.bashrc

Checking the Results

After configuration, here’s a simple benchmark:

time (sudo dnf clean all && sudo dnf makecache)

On my machine, makecache dropped from ~45 seconds to ~12 seconds after enabling fastestmirror and parallel downloads. You’ll see even better results with a 100Mbps+ connection.

After two years of using Fedora as my main dev machine, this setup has never let me down. Fedora releases a new version every 6 months with always bleeding-edge packages — just make sure downloads aren’t your bottleneck, and the experience is in a completely different league.

Share: