Slow Rocky Linux package installs usually come from conservative download concurrency, a distant mirror, or a proxy path that adds latency. DNF handles package installs, upgrades, and dependency resolution, so these settings affect everyday dnf install and dnf upgrade runs. You can increase DNF speed on Rocky Linux by enabling parallel downloads and fastest mirror selection in /etc/dnf/dnf.conf, then confirming the active values before running normal upgrades.
Rocky Linux 10, 9, and 8 use the same DNF4 settings for this workflow. Rocky Linux 10 does not use Fedora’s DNF5 command syntax here, so keep the configuration in dnf.conf and verify it with dnf config-manager --dump.
Increase DNF Speed on Rocky Linux
Two settings do most of the useful work: max_parallel_downloads controls how many packages DNF can fetch at once, while fastestmirror changes how DNF chooses mirrors from repository metalink or mirrorlist data. The related safety settings are worth understanding, but they should normally stay at Rocky Linux defaults.
| Setting | Rocky Linux Default | Recommended Value | What It Changes |
|---|---|---|---|
| max_parallel_downloads | 3 | 10 | Downloads several packages at the same time during installs and upgrades |
| fastestmirror | False | True | Selects lower-latency mirrors instead of trusting only the mirrorlist order |
| gpgcheck | 1 | 1 | Verifies package signatures and should stay enabled |
| installonly_limit | 3 | 3 | Keeps a small set of fallback kernels available in GRUB |
| clean_requirements_on_remove | True | True | Lets DNF remove dependency packages that are no longer needed |
The official DNF configuration reference lists max_parallel_downloads as a setting with a default of 3 and a maximum of 20. A value of 10 is a practical starting point for most servers and workstations because it improves large transactions without opening the maximum number of connections.
Check Current DNF Settings on Rocky Linux
The config-manager subcommand comes from dnf-plugins-core. Most full Rocky Linux installs already have it, but minimal server images may need the package before the inspection command works.
rpm -q --queryformat '%{NAME}\n' dnf-plugins-core
A system with the plugin package installed returns the package name:
dnf-plugins-core
If RPM reports that dnf-plugins-core is not installed, install it from the Rocky Linux repositories:
sudo dnf install dnf-plugins-core
Commands that start with
sudorequire an administrator account. If your user cannot runsudo, sign in with an account that has sudo access or ask the system administrator to apply the change.
Inspect the active DNF values before editing the file:
dnf config-manager --dump | grep -E 'max_parallel|fastest|gpgcheck|installonly|best|skip_if|clean_req'
Default Rocky Linux 10, 9, and 8 systems return these relevant values:
best = 1 clean_requirements_on_remove = 1 fastestmirror = 0 gpgcheck = 1 installonly_limit = 3 max_parallel_downloads = 3 skip_if_unavailable = 0
The important baseline is max_parallel_downloads = 3 and fastestmirror = 0. Those are the values to change for faster package downloads.
Edit the DNF Configuration File
Open the main DNF configuration file with a text editor. This example uses nano, but any terminal editor is fine:
sudo nano /etc/dnf/dnf.conf
All global DNF settings belong under the [main] section. If either key already exists, edit the existing line instead of adding a duplicate entry.
max_parallel_downloads=10
fastestmirror=True
max_parallel_downloads=10 lets DNF fetch up to 10 packages at once. fastestmirror=True makes DNF test TCP socket latency and choose randomly from mirrors with less than twice the lowest latency, which keeps mirror selection fast without sending every client to the same server.
Save the file when the [main] section includes the optimized values:
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
max_parallel_downloads=10
fastestmirror=True
Verify DNF Speed Settings
Run the configuration dump again and filter it to the two speed-related keys:
dnf config-manager --dump | grep -E 'max_parallel|fastest'
The active values should now match the optimized configuration:
fastestmirror = 1 max_parallel_downloads = 10
Preview a refreshed upgrade first if you want to test repository metadata without installing packages. The --assumeno flag makes DNF answer no to the transaction prompt after it calculates the update set:
sudo dnf upgrade --refresh --assumeno
When you are ready to apply available updates, run the same refreshed upgrade without --assumeno:
sudo dnf upgrade --refresh
During a transaction with multiple packages, DNF should download several packages concurrently. If only metadata is refreshed or no packages are available, there may not be enough package downloads in that run to show the difference.
Tune Additional DNF Options Carefully
The settings in this section are not speed tweaks for most systems. Keep them at Rocky Linux defaults unless you have a specific administrative reason to change package verification, kernel retention, dependency cleanup, or dependency resolution behavior.
Package Signature Verification with gpgcheck
gpgcheck=1
Rocky Linux sets package signature verification in the main DNF configuration. Leave gpgcheck=1 enabled so DNF verifies packages before installing them. Disabling it weakens package trust and should not be part of a speed optimization.
Kernel Retention with installonly_limit
installonly_limit=3
installonly_limit=3 keeps the current kernel plus older fallback kernels available. That default protects rollback options after a kernel update while limiting disk growth from older kernel packages.
Dependency Cleanup with clean_requirements_on_remove
clean_requirements_on_remove=True
When this option is enabled, DNF can remove dependency packages that it installed automatically and that no installed package still needs. Keep the default unless you intentionally want to preserve dependency packages after removals.
Repository Availability with skip_if_unavailable
skip_if_unavailable=False
skip_if_unavailable=False makes repository synchronization failures visible instead of silently disabling a repository for that run. This is safer for security updates because a broken or unreachable repository should be investigated, not hidden.
Version Selection with best
best=True
Rocky Linux sets best=True, which tells DNF to prefer the highest available version for directly requested packages or fail when dependencies prevent that result. Keep this default so dependency conflicts are visible during installs and upgrades.
Tune Parallel Downloads for Your Connection
max_parallel_downloads=10 is a starting point, not a benchmark promise. If DNF starts retrying downloads, your VPN becomes unstable, or a weak Wi-Fi connection feels worse, lower the value and test the next normal update cycle.
- 5: Better for unreliable Wi-Fi, VPN links, or smaller VPS connections.
- 10: Best starting point for most Rocky Linux systems.
- 15 to 20: Worth testing only on fast, stable connections where large DNF transactions still spend most of their time downloading packages.
Use a Complete Optimized dnf.conf Reference
Use this complete [main] section as a reference when reviewing your file. Do not overwrite custom proxy, cache, or administrative settings that your system already needs.
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
max_parallel_downloads=10
fastestmirror=True
After saving the file, rerun dnf config-manager --dump | grep -E 'max_parallel|fastest'. The two values should appear as max_parallel_downloads = 10 and fastestmirror = 1.
Reset DNF Speed Settings on Rocky Linux
If the tuning does not help your network, reopen /etc/dnf/dnf.conf and return the two speed settings to Rocky Linux defaults:
sudo nano /etc/dnf/dnf.conf
max_parallel_downloads=3
fastestmirror=False
You can also remove both lines entirely, since those are the runtime defaults. Verify the active values after saving the file:
dnf config-manager --dump | grep -E 'max_parallel|fastest'
fastestmirror = 0 max_parallel_downloads = 3
Troubleshoot DNF Speed and Configuration Issues
config-manager Command Is Missing
If the settings check fails, the plugin package is missing or DNF plugins are disabled:
dnf config-manager --dump
A missing plugin command can look like this:
No such command: config-manager. Please use /usr/bin/dnf --help It could be a DNF plugin command, but loading of plugins is currently disabled.
Install dnf-plugins-core, then rerun the settings check:
sudo dnf install dnf-plugins-core
dnf config-manager --dump | grep -E 'max_parallel|fastest'
DNF Reports an Invalid Configuration Value
DNF validates boolean values when it reads the configuration. A typo such as fastestmirror=maybe can produce a warning during the settings check:
dnf config-manager --dump
Relevant output includes:
Invalid configuration value: fastestmirror=maybe in /etc/dnf/dnf.conf; invalid boolean value 'maybe'
Edit /etc/dnf/dnf.conf and use supported boolean values such as True, False, 1, or 0. Then run the filtered configuration dump again to confirm the corrected value.
DNF Downloads Are Still Slow
fastestmirror=True measures latency, not actual mirror throughput. If downloads remain slow, check for proxy entries first because a proxy, VPN, or forced network gateway can dominate mirror speed.
grep -R --line-number -E '^[[:space:]]*proxy[[:space:]]*=' /etc/dnf/dnf.conf /etc/yum.repos.d/*.repo || echo "No DNF proxy entries found"
A system without DNF proxy overrides returns:
No DNF proxy entries found
If a proxy line appears, confirm that the proxy is intentional and reachable. After changing proxy or mirror-related settings, refresh metadata again:
sudo dnf clean metadata
sudo dnf makecache --refresh
Related Rocky Linux Guides
DNF tuning also applies when Rocky Linux pulls packages from extra repositories. If you need software outside the base repositories, install EPEL on Rocky Linux for community-maintained server and CLI packages, or install RPM Fusion on Rocky Linux for multimedia and other packages with licensing restrictions.
Conclusion
After this change, DNF uses 10 parallel downloads and lower-latency mirror selection while Rocky Linux keeps package signature checks, kernel fallback retention, and dependency cleanup at safe defaults. For ongoing maintenance, use sudo dnf upgrade --refresh for normal system updates and revisit the related repository guides when you add EPEL or RPM Fusion packages.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><a href="https://example.com">link</a><blockquote>quote</blockquote>