Home Fedora How To Speed Up DNF Package Manager In Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux

How To Speed Up DNF Package Manager In Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux

Increase package download speed using DNF package manager in RPM-based systems

By sk
Published: Last Updated on 18,143 Views

If you're experiencing slow package downloads or updates, here is a workaround to speed up DNF package manager in Fedora, RHEL.

This guide is officially tested in Fedora, however it should work in all RHEL-based systems such as CentOS, AlmaLinux and Rocky Linux that uses DNF as their default package manager.

Introduction

As you already know, DNF is the default package manager for Fedora 25 and newer versions, RHEL 8 and its clone CentOS 8, AlmaLinux 8, and Rocky Linux 8.

The other day I decided to try Fedora 35. I downloaded the Fedora 35 Vagrant box and run it with Oracle Virtualbox. The first thing I noticed after trying Fedora 35 is that the DNF package manager is terribly slow.

I thought DNF might perform slow when it updates the repositories and metadata for the first time. But, it was still slow in the subsequent times. After a couple web searches, I found a solution that worked for me.

Speed up DNF package manager in Fedora, RHEL and its clones

We can increase the download speed while installing packages using the DNF package manager by increasing the maximum number of simultaneous package downloads.

To do so, edit /etc/dnf/dnf.conf file:

$ sudo nano /etc/dnf/dnf.conf

Add the following line:

max_parallel_downloads=10
Speed Up DNF Package Manager In Linux
Speed Up DNF Package Manager In Linux

This option tells the DNF to use 10 parallel downloads at the same time. You can increase or decrease this value as per your wish. The default value for max_parallel_downloads option is 3. Press CTRL+O to save the changes and press CTRL+X to exit.

Now try to perform any package operation with DNF command. You will notice the speed difference while downloading the packages.

Choose fastest mirror

The another option to speed up DNF is to select fastest mirror from the Fedora public mirrors. To do so, again edit the /etc/dnf/dnf.conf file:

$ sudo nano /etc/dnf/dnf.conf

Add the following line:

fastestmirror=True

Press CTRL+O followed by CTRL+X to save the file and exit.

Now I can see a noticeable difference when installing and updating packages with DNF in my Fedora 33 virtual machine.

In my experience, DNF takes longer to download metadata than to download a package. This is because Fedora metadata is larger than the other package manager's. So I guess DNF is slow only when updating the repository metadata. After that, it works smoothly.

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More