How to Use ‘apt-fast’ to Speed Up apt-get/apt Package Downloads Using Multiple Mirrors

In this editorial, we take a look at a great and powerful utility called apt-fast that you can use to speed up downloading packages by APT or Aptitude.

apt-fast is an open-source shell script wrapper for the popular APT and Aptitude package managing tools that helps to speed the downloading of packages on Debian systems.

It’s main function is to remarkably speed up the downloading of packages by apt-get or aptitude by downloading packages in parallel, with numerous connections per package.

Read some of the following articles, that discusses about APT and Aptitude along with their usage with examples:

  1. What’s Difference Between APT and Aptitude
  2. 25 Useful Commands of apt-get for Package Management
  3. 15 Useful APT Commands for Package Management
  4. Learn Package Management with Aptitude in Ubuntu

Requirement for running apt-fast utility, is to have aria2c or axel download managers.

  1. How to Install Aria2 Command-Line Download Manager
  2. How to Install Axel to Speed Up FTP/HTTP Downloads

How to Install apt-fast on Ubuntu 16.04-14.04 and Linux Mint 18/17.x

Firstly add the the PPA for apt-fast package as follows and then update your system.

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

Thereafter, run the command below to install apt-fast tool:

$ sudo apt-get -y install apt-fast

During the apt-fast installation process, you will be prompted to perform some package configuration as follows.

In the screen below, you can set the number of connections allowed, remember, you can also configure it later in the apt-fast configuration file using the _MAXNUM directive.

Configure apt-fast Maximum Connections

Configure apt-fast Maximum Connections

Next, you can also choose to suppress the apt-fast confirmation message every time you want to install a package. But leaving the default value is okay, therefore, choose <No> and hit Enter to advance.

Configure apt-fast

Configure apt-fast

How to Use apt-fast?

After successfully installing apt-fast, simply use it the same way you run apt or aptitude commands.

The apt-fast configuration file is: /etc/apt-fast.conf, you can further increase your download speeds by adding multiple mirrors and distribute load, make sure to add nearest mirrors.

Official mirror lists for Debian and Ubuntu/Linux Mint:

  1. Debian: http://www.debian.org/mirror/list
  2. Ubuntu: https://launchpad.net/ubuntu/+archivemirrors

You can add them to whitespace and comma separated mirrors in the configuration file as follows:

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' )

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/' )

Important: To use mirrors in /etc/apt/sources.list or /etc/apt/sources.list.d/, you also need to add them to /etc/apt-fast.conf as well.

$ sudo vi /etc/apt-fast.conf
Configure apt-fast Mirrors

Configure apt-fast Mirrors

You also view the man page for apt-fast and apt-fast.conf as follows:

$ man apt-fast
$ man apt-fast.conf

Let us dive into how apt-fast works by installing git package as follows:

$ sudo apt-fast install git

You will be asked to confirm whether to download package or not, enter Yes/Y to continue. The image below shows apt-fast working – downloading git package using several connections.

Install Packages Using apt-fast

Install Packages Using apt-fast

After downloading the git package, you will again be asked to install it by entering Yes/Y and press Enter to proceed with the installation process.

Some important apt-fast commands:

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

In case a downloading process stops or breaks, run the command below:

$ sudo apt-fast clean 

For more information, visit the apt-fast Github repository.

Conclusion

Here, we reviewed a powerful shell-script front-end for apt and aptitude that helps you to boost download speeds while installing packages on your Debian-based systems such as Ubuntu, Linux Mint and many more.

What is you experience with apt-fast? Do you think it works well for you? Then give us your thoughts plus any other questions you would like to ask, via the feedback form below.

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

9 Responses

  1. Darth Decius says:

    sudo apt-fast dist-upGRADE not UPDATE

  2. Joe Gilbert says:

    I discovered this wrapper about a year ago. Any time I install Linux, I then install this. It should be put into the mainline repos. It is a must have.

    • Aaron Kili says:

      @Joe

      Yes, i absolutely agree with you, this is a great front-end for apt/apt-get/aptitude for Debian systems. Its efficient and reliable as well, including it in mainline repos would be so useful.

  3. Junaid Ali says:

    Thanks a lot for very helpful and detailed article, I Just want to know something . See, in windows IDM i can use multithreaded downloading and set threads upto 32 max, so each file to be downloaded gets divided into 32 parts and every thread downloads its part simultaneously.

    I want to use apt-fast for the same purpose, can you please guide me, how can i configure concurrent downloading threads or segments in apt-fast configurations ?? is it Max Number Of Connections or something else.

    Sorry for my poor communication skills hope you understand what i want to know and help me, thanks a lot again

    Regards

    • Aaron Kili K says:

      @Junaid

      Yes, it is the Max Number of Connections

      apt-fast uses more than one connection to download a single package, which i suppose is similar to the multithreaded downloading. Therefore, you need to set the Max Number of Connections to achieve something similar.

  4. Larry H. says:

    It cut my update time significantly. Running Mint 17.2 (Mate). Thanks.

  5. Allan says:

    thank you, I am use Ubuntu 16.04

Leave a Reply to Larry H. Cancel reply

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

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