loading...

Speed up Ubuntu apt-get downloads with apt-fast

dexterbrylle profile image Dexter Brylle ・2 min read

Intro

I've been experiencing slow download speeds on my Ubuntu VirtualBox a couple of weeks ago. Initially, I thought that my internet connection was acting up again (I have an 8 Mbps connection at home), so I did speed tests. However, tests consistent which led me to conclude that it's probably an Ubuntu mirror server thing. Half a day passed, and the connection was still a struggle so I cleaned my sources list and changed them from the mirror that my location was using to US with:

    sudo sed -i 's/http:\/\/us./http:\/\//g' /etc/apt/sources.list

apt-fast

So, speed was normal again. However, I kept thinking about the latency of downloading it from the server that I set it to. With a few Google searches, I came up with this great package that uses parallel connections to speed up downloads. It's apt-fast.

apt-fast is a shellscript wrapper for apt-get and aptitude that can drastically improve apt download times by downloading packages in parallel, with multiple connections per package.

I felt the drastic improvement! You can install it by following the set of commands below:

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

How to use apt-fast

You'll use apt-fast the same way you'd use apt-get or aptitude.

sudo apt-fast update
sudo apt-fast install -y <package-name>
sudo apt-fast dist-upgrade
sudo apt-fast remove

Further increase download speeds

You can add mirrors that are closest to your location for better results. Open up:

sudo vim etc/apt-fast.conf

Then add this line of code:

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

You can read more about apt-fast on its Github repository.

This was originally published on my blog

Discussion

pic
Editor guide