In one of our previous articles, we have explained how to use apt package manager in order to perform different operations like searching for available packages, installing or upgrading packages, removing packages, etc. But today, we will discuss another utility that can improve the download speed of apt packages and that is known as apt-fast.
Apt-fast is a shell script wrapper for “apt-get” and “aptitude” that utilizes the power of axel or aria 2 download managers to accelerate the download process. It improves download performance by downloading packages simultaneously and with multiple packages per connection.
In this article, we will explain how to install apt-fast in order to accelerate the update and downloading process. We have run the commands and procedure mentioned in this article on a Debian10 system.
Step 1: Installing prerequisites
In order to use apt-fast, first we have to install axel or aria2 command-line download accelerators. Both are great tools that help to improve the download speed with multiple connections per package.
Launch the Terminal application in your system by going into the Activities tab in the top left corner of your desktop. Then in the search bar, type terminal. When the Terminal icon appears, click on it to launch it. Then run the following command in Terminal to install axel or aria2:
$ sudo apt-get install axel
$ sudo apt-get install aria2
Step 2: Installing and configuring apt-fast
For installing apt-fast, first we will have to add the repository key for apt-fast. It will allow the system to trust the packages being added from the repository. Run the following command in Terminal to add the key:
$ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1EE2FF37CA8DA16B
After adding the key, add PPA repository of apt-fast to your system by running the following command in Terminal:
$ add-apt-repository ppa:apt-fast/stable
Now update the local apt repository by running the following command in Terminal:
$ apt-get update
Finally, run the following command in Terminal to install apt-fast:
$ apt-get -y install apt-fast
During the installation of apt-fast, a window will pop-up for you to configure apt-fast.
When the following screen appears, select apt-get as a package manager and hit Enter to move to the next step.
Now choose the maximum number of connections allowed. Leave it as default. Hit enter to move on to the next step.
Remember, you can also set the maximum number of connections later using the _MAXNUM variable in the configuration files.
You can choose to suppress the apt-fast confirmation dialog each time you want to install a package. For that leave the default value <No> and press Enter.
Once the installation is completed, we will need to do a basic configuration. The default configuration file of apt-fast is at /etc/apt-fast.
Run the following command in Terminal to edit the configuration file in an editor:
$ sudo nano /etc/apt-fast.conf
In the configuration file, add the comma separated mirrors in the following syntax:
MIRRORS=( http://ftp.debian.org/debian, http://ftp2.de.debian.org’)
Use the following Debian’s official mirror page and add nearest mirrors based on your geographical location.
Also add the mirrors that are present in /etc/apt/sources.list or in the apt-fast configuration file /etc/apt-fast.conf.
Step 3: Using Apt-fast
Once you are done with the installation and configuration of apt-fast, use it in the same way as you use apt-get. Just substitute fast instead of get in the apt-get command. Following are some useful commands in order to use apt-fast:
Use the following command to install a package using apt-fast:
$ sudo apt-fast install package_name
Use the following command to remove a package using apt-fast:
$ sudo apt-fast remove package_name
Use the following command to update a package using apt-fast:
$ sudo apt-fast update
Use the following command to upgrade a package using apt-fast:
$ sudo apt-fast upgrade
Let’s see how apt-fast works by installing Apache2. To do so, run the following command in Terminal:
$ sudo apt-fast install apache2
It will ask for confirmation, enter y to confirm.
From the above results, you can see that it is downloading the Apache2 package using multiple connections.
In this article, we have seen how the apt-fast utility can be used for not only installing the software packages on your system but also for increasing the download speed. Now enjoy the fast download experience!