Apt-Fast : To speed up your package downloads in Ubuntu/Debian

Apt-Fast is a small shell script wrapper that can drastically improve apt-get & aptitude download speed using multi threaded tool such as axel and aria2 which is simultaneously download packages with multiple connections per package (from different sources).

This will be suitable for bigger download and OS upgrade. I have tested this and realized 2-3 times fast compare with normal apt-get. You can also give a try and update your feedback, make sure this purely depends upon your Internet connection.

Suggested Read :
(#) APT (Advanced Packaging Tool) : Advanced Package Management tool for Debian Based Systems
(#) Apt-Get & Apt-Cache commands to manage packages on Debian Based Systems

Install Prerequisites

In order to use Apt-Fast, we have to install either axel or aria2 multi-protocol & multi-source command-line download utility.

$ sudo apt-get install curl git

$ sudo apt-get install aria2
or
$ sudo apt-get install axel

Navigate to following links to know more about an utility.

Suggested Read :
(#) Speed up your downloads with Axel command line downloader/accelerator
(#) aria2 (Command Line Downloader) command examples

Install Apt-Fast in Debian based system

There is no official package for Debian system but one good thing, developer offering a shell script to install Apt-Fast quickly.

$ sudo /bin/bash -c "$(curl -sL https://git.io/vokNn)"

Use the following PPA to install Apt-Fast on Ubuntu 14.04 and later versions.

$ sudo add-apt-repository ppa:saiarcot895/myppa
$ sudo apt-get update
$ sudo apt-get -y install apt-fast

Configure Apt-Fast

After installation, open /etc/apt-fast.conf file and add following mirrors based on your distribution.

Also navigate to following distribution official mirror page and get nearest mirrors based on your geographical location and add it.

Add a mirrors using the below format with space and comma to separate it.

$ sudo nano /etc/apt-fast.conf

[For Ubuntu/Linux Mint]
MIRRORS=( 'http://archive.ubuntu.com/ubuntu, http://de.archive.ubuntu.com/ubuntu, 
http://ftp.halifax.rwth-aachen.de/ubuntu, http://ftp.uni-kl.de/pub/linux/ubuntu, http://mirror.informatik.uni-
mannheim.de/pub/linux/distributions/ubuntu/' )

[For Debian]
MIRRORS=( 'http://ftp.debian.org/debian, http://ftp2.de.debian.org/debian, 
http://ftp.de.debian.org/debian, ftp://ftp.uni-kl.de/debian' )

Note : Make sure you have to add all the mirrors which was present in /etc/apt/sources.list or /etc/apt/sources.list.d/ to /etc/apt-fast.conf file.

How to use Apt-Fast ?

We have successfully installed and configured Apt-Fast. Now, its time to use Apt-Fast. Apt-Fast is similar to Apt-Get, so use FAST instead of GET followed by Apt and rest of the things are same.

[Syntax for Apt-Fast]
$ apt-fast [options] [arguments]

[Install Package using Apt-Fast]
$ apt-fast install package-1 package-2

For demonstration purpose, we are going to install MariDB package with help of Apt-Fast command to check either it’s improving the package download speed or not?

$ sudo apt-fast install mariadb-server

It will be asking you to confirm before initiate package download through apt-fast.

Yes, it used multiple connection to download the MariaDB package, as I can clearly see in the below screen shot.

Use the following frequent/routine commands on your system to boost package download speeds.

$ sudo apt-fast update
$ sudo apt-fast upgrade 
$ sudo apt-fast dist-update

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

Leave a Reply

Your email address will not be published. Required fields are marked *