Speed Up Package Manager With Simultaneous Downloads

Enable Parallel Downloading In Your Package Manager

Whenever you install any application or start upgrading your Linux-based operating systems, the default package manager such as dnf, apt, or Pacman first downloads all the packages and dependencies one by one and then installs all the packages one after the other. Now you can make the whole process faster either by having a fast storage drive or by having a fast Internet connection.

Alternatively, you can set the package manager to simultaneously download multiple packages, so if you have a fast internet connection, the downloading will be super quick. In this tutorial, we will modify the conf file of all the above-mentioned distribution-specific package managers. So open a Terminal window and let’s get started.

Enabling Parallel downloads in Arch-based distribution

Arch Linux and its derivative Linux distributions such as Manjaro or Endeavour use pacman to install and upgrade all the packages. To enable parallel downloads, we have to modify the pacman.conf file located in the /etc/directory. Open the conf file in your favorite text editor by typing the following command in a Terminal Window :

# For vim users
sudo vim /etc/pacman.conf

# For Nano users
sudo nano /etc/pacman.conf
Enable Parallel Downloads In Pacman Package Manager
Enable Parallel Downloads In Pacman Package Manager

In the vim text editor, press the ‘i’ key to get into insert mode and look for a line named ParallelDownloads, set the value as per your preference. I prefer 10 packages to download simultaneously.

Vim users can press the Escape key and then type :wq to save and exit out of vim. Nano users can press Ctrl+O and Ctrl+X to save and exit. Next time you will install anything, Pacman will download the specified number of packages simultaneously.

Also read: Vim Tutorial – All You Need, To Get Started with VIM

Enable parallel downloads in DNF

DNF is the default package manager in Fedora Workstation, similar to Pacman, we have to modify the dnf.conf file located in the /etc/dnf/ directory. Open the file in your favorite text editor by typing :

# For vim users
sudo vim /etc/dnf/dnf.conf

# For nano users
sudo nano /etc/dnf/dnf.conf

If you’re using Vim editor, then press ‘I’ to get into the Insert mode and add the following line –

max_parallel_downloads=10

You can change the value as per your preference. Now, vim editor users can press the ‘Escape’ key to get out of insert mode and then type :wq to save and exit. Nano editor users can press Ctrl+O and Ctrl+X to save and exit.

Summary

That’s about it! The apt package manager in Ubuntu and Debian-based distributions does not support parallel downloads for now, so it was not discussed here. You can install the apt-fast command to achieve the same goal, but I think it should be added to apt because Ubuntu and Ubuntu-based distributions are the Linux Operating Systems with the largest user base.

References