DNF’s default configuration downloads packages one at a time using automatically selected mirrors, which can slow down system updates significantly. By configuring parallel downloads and fastest mirror selection, you can reduce typical update times from 5-10 minutes to 2-3 minutes on standard broadband connections. This guide shows you how to modify two configuration settings that enable DNF to download up to 10 packages simultaneously while automatically selecting the fastest available mirror based on network latency.
You will learn how to edit the DNF configuration file to enable parallel downloads (increasing from the default 3 simultaneous downloads to 10) and activate fastest mirror selection (disabled by default). These optimizations work by allowing DNF to fetch multiple packages at once while intelligently routing traffic to the mirrors with the lowest latency. By the end of this guide, you will have a noticeably faster package management experience, particularly when installing multiple packages or performing full system updates. For users managing servers or multiple systems, consider automating updates with DNF Automatic after optimizing download speeds.
These configuration changes work on all currently supported Fedora releases (Fedora 42, 43) which use DNF5 as the default package manager.
Edit the DNF Configuration File
Access the DNF configuration file with your preferred text editor:
sudo nano /etc/dnf/dnf.conf
Configure Parallel Downloads
DNF defaults to downloading 3 packages simultaneously, which underutilizes most modern internet connections. Increasing this to 10 parallel downloads significantly improves update speeds without overwhelming typical home or office networks.
In the dnf.conf file, add the following line under the [main] section:
max_parallel_downloads=10
The max_parallel_downloads parameter controls how many packages DNF fetches simultaneously. The default value is 3, and the maximum allowed is 20. Choose a value based on your connection speed:
- Slow connections (< 10 Mbps): Set to 5 parallel downloads
- Medium connections (10-50 Mbps): Set to 10 parallel downloads (recommended for most users)
- Fast connections (50-100 Mbps): Set to 10-15 parallel downloads
- Datacenter/fiber (100+ Mbps): Set to 15-20 parallel downloads (maximum)
A setting of 10 provides the best balance between speed and system stability for typical home broadband connections without causing network congestion.
Enable Fastest Mirror Selection
Add this line to your dnf.conf file to enable fastest mirror selection:
fastestmirror=True
Fedora’s mirror infrastructure uses MirrorManager to intelligently route downloads based on geographic location and mirror availability through the metalink/mirrorlist system. The fastestmirror option is disabled by default (set to False). When enabled, DNF measures TCP latency to available mirrors and selects one at random from those with less than twice the lowest latency, providing both speed optimization and load balancing. This overrides the default metalink/mirrorlist geographic routing. The initial mirror selection adds 5-15 seconds to the first DNF operation after enabling this setting, but subsequent operations benefit from consistently faster downloads. For systems behind corporate proxies or with complex network routing, you may want to test both enabled and disabled states to determine which provides better performance in your specific environment.
Your /etc/dnf/dnf.conf file should now include both optimization settings:
[main] gpgcheck=True installonly_limit=3 clean_requirements_on_remove=True best=False skip_if_unavailable=False max_parallel_downloads=10 fastestmirror=True
After adding both configuration lines, save your changes (CTRL+O) and exit (CTRL+X) if using nano.
Verify Configuration Changes
Confirm your settings were applied correctly by checking the config file directly:
grep -E 'max_parallel_downloads|fastestmirror' /etc/dnf/dnf.conf
You should see output confirming both settings:
max_parallel_downloads=10 fastestmirror=True
You can also verify the active runtime configuration with
sudo dnf config-manager dump | grep -E 'max_parallel_downloads|fastestmirror'. This shows the settings DNF is actually using, which is useful when troubleshooting if config file changes don’t seem to take effect.
Test the Speed Improvements
Test your optimized configuration by refreshing metadata and checking for updates:
sudo dnf upgrade --refresh
The first run after enabling fastestmirror will include mirror speed testing:
Fedora 43 - x86_64 1.2 MB/s | 22 MB 00:18 Fedora 43 openh264 (From Cisco) 1.5 kB/s | 2.5 kB 00:01 Fedora 43 - x86_64 - Updates 1.8 MB/s | 28 MB 00:15 Determining fastest mirrors (10/450): package1-1.0-1.fc43.x86_64.rpm 450 kB/s | 125 kB 00:00 (10/450): package2-2.1-1.fc43.x86_64.rpm 890 kB/s | 380 kB 00:00 (10/450): package3-1.5-2.fc43.x86_64.rpm 1.2 MB/s | 670 kB 00:00
Notice the parallel download indicators showing multiple packages downloading simultaneously (the count in parentheses shows current/total packages). Subsequent DNF operations will skip mirror testing and use the cached fastest mirror selection.
Troubleshooting Common Issues
Downloads Still Slow After Configuration
If downloads remain slow after applying these settings, verify your configuration took effect:
sudo dnf config-manager dump | grep -E 'max_parallel_downloads|fastestmirror'
Expected output showing active settings:
fastestmirror=True max_parallel_downloads=10
If settings show different values, check for syntax errors in your /etc/dnf/dnf.conf file. Ensure the lines are under the [main] section and have no extra spaces or typos.
Mirror Selection Takes Too Long
If fastest mirror detection consistently takes over 30 seconds, your network may have high latency to Fedora’s mirror infrastructure. Disable fastest mirror selection and rely on Fedora’s default geographic routing:
sudo sed -i 's/^fastestmirror=True/fastestmirror=False/' /etc/dnf/dnf.conf
Then test performance again. Geographic routing often performs better for users behind corporate proxies or in regions with limited mirror coverage.
Connection Timeouts with Parallel Downloads
If you experience frequent connection timeouts or “Cannot download” errors after increasing parallel downloads, your connection may be bandwidth-limited. Reduce the parallel download count:
sudo sed -i 's/^max_parallel_downloads=10/max_parallel_downloads=5/' /etc/dnf/dnf.conf
A setting of 5 works reliably on connections as slow as 10 Mbps while still providing noticeable speed improvements over the default 3.
Reverting to Default Settings
If you need to restore the default DNF behavior, edit /etc/dnf/dnf.conf and either remove the custom lines or set them back to defaults:
sudo sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=3/' /etc/dnf/dnf.conf
sudo sed -i 's/^fastestmirror=.*/fastestmirror=False/' /etc/dnf/dnf.conf
Verify the changes took effect:
grep -E 'max_parallel_downloads|fastestmirror' /etc/dnf/dnf.conf
You should see the default values restored:
max_parallel_downloads=3 fastestmirror=False
Conclusion
Configuring parallel downloads and fastest mirror selection noticeably reduces the time spent waiting for package operations. The combination of 10 simultaneous downloads and automatic mirror optimization transforms routine system updates into quick maintenance tasks.
These settings apply to all DNF operations, including package installations, routine updates, and major version upgrades via DNF5. Monitor your download performance with dnf --verbose upgrade to see real-time transfer speeds and mirror selection results. For automated maintenance, configure DNF Automatic to apply updates unattended using your optimized settings.