DEV Community

Dexter Brylle
Dexter Brylle

Posted on

4

Speed up Ubuntu apt-get downloads with apt-fast

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

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay