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

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

๐Ÿ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay