Main Menu
Woot Alarm
Zen Kernel
Dish Keys
Search Bible
Feed Me!


Add to Google

Add to Pageflakes

Subscribe in Bloglines

Add to My AOL


apt-fast and Axel: Roughly 26x Faster apt-get Installations and Upgrades
Monday, 02 June 2008
Updated 12/22/2011

apt-fast Development is now on GitHub:

About apt-fast:

The apt-fast script I have created is a little shellscript that increases the speed of apt-get by many times. You need to have axel or aria2c installed as a download manager, which is a simple, short process, but everything else is extremely straight forward. I started out downloading the upgrades for Kubuntu, at 32kb/s. Not terrible, but not that great. When I was done with the script here, I was getting up to ~850kb/s. That is great!

Once you've setup apt-fast, you can use it like apt-get. To install a single package, make sure your database is up to date (apt-fast update), and run apt-fast install packagenamehere. Watch it download with incredible speed, and install your requested packages. To upgrade or dist-upgrade, do the same thing. Just use apt-fast dist-upgrade or apt-fast upgrade. That's all there is to it!

Should your download stall for any number of reasons, you'll need to do an apt-fast clean.

This is a fully opensource script, of course, under the GPLv3, so please improve upon it and modify it as you will. If you do something cool with it, or make a useful mod to the code, please pastebin it or put it in a forum somewhere and put a link in the comments below. I'll give you credit and add it to the script here on

richard  - thank you   | |2009-06-16 18:31:37
I found it this morning, it's fast, help me a lot, thank you very much.
Toby Hyanes  - Don't forget to check for nothing...   | |2009-11-02 09:56:13
With apt-get upgrade/ apt-get dist-upgrade, it's possible that there is nothing
to do. You probably want to check the number of lines in debs.list and exit if
there are no URIs to process.
armand  - problem when unpacking and installing   | |2009-11-04 07:46:36
That's a pretty good Idea but I think needs some improvement! I tried more than
once to get the job done with apt-fast , it downloads well but gives some errors
when unpacking and installing. I hope u will fix it
Matt Parnell  - I use Archlinux now...not ubuntu   | |2009-11-04 15:34:56
I don't use ubuntu anymore...feel free to fix it yourself and post it here in
the comments if you'd like.
hyao  - thanks   | |2009-11-10 07:51:35
very useful and thank you!
Michael  - Source code   | |2010-03-06 00:40:11
Can i know where the source code is? Precious thank
Click   | |2010-03-06 11:48:51
Super. tnx
Matt Parnell  -   | |2010-03-08 13:58:24 is where the source is. I said so in
the article.
snowy  - would like to see it do more   | |2010-03-12 01:11:40
would like apt-fast to download every package at once
not separately
then i
could say download 20 downloads with 20 parts put together and not have to wait
for all the slow mirrors before all the downloads are done

plus i'd like to be
able to tell what apt-fast does for instance download 1-20 downloads @ 1-20

the best way to show something like this is if you download a copy of
jdownloader and run it with java

id like to see if anyone could build this then
it might just lead to a package manager with java in mined that way apt-get
would be obsolite

the script you wrote replaced my apt-get in ubuntu 10.04
alpha 3
please downt forget that apt-get is old hat and that apt-fast is getting
soooo much better
cool sh by the way would like some work done on it so it can
and will beat any form of package managment on the planet

loved it but it could
be awsome
Xaekai   | |2011-01-02 10:20:58
Whoa... It's a pre-fetching wrapper for apt-get. Without apt-get or similar dpkg
backend it would serve no purpose.

That kinda makes your old-hat and obsolete
comments kinda assinine
Matt Parnell  - If you want it, you do it.   | |2010-03-14 13:46:13
I don't use apt based Linux anymore.

I use Archlinux because it's better, at
least in my opinion.

The script is opensource and I appreciate you enjoying it,
but I'm not really working on it anymore.

The PCLinuxOS guys have been the ones
updating it lately.

A gui would be unnecessary, by the way.
Salih Emin  - GUI is necessary   | |2010-03-14 16:35:04
Its a great piece of script. So I've decided to integrate it in my piece of
software 2clickUpdate found at

Its a GUI
script that speeds up the updating of the operating system and programs
installed without bothering you with
Ryan  - Automatic sudo   | |2010-04-10 11:31:42
To have the script automatically sudo itself if you forget to do so, add the
following line at the beginning:

[ "`whoami`" = root ] || sudo
"$0" "$@"

Then if you run apt-fast as a normal user, it
will simply re-run itself with sudo.
Ryan  - Fixed auto-sudo   | |2010-04-10 11:59:15
Oops! Here's the fixed line:

[ "`whoami`" = root ] || exec sudo
"$0" "$@"
David Nesting  - Auto-sudo harmful   | |2010-11-15 10:06:29
This isn't a great security practice. Don't train users to type their password
into any script that asks them for it. How do they know that it's really sudo
asking them for their password? Train them to explicitly use sudo when the
situation calls for it.
Salih Emin  - 2clickUpdate has implemented Axel   | |2010-04-14 06:32:37
As I mentiond in previous comment I was going to integrate axel in

You can read full announcement at

H ope it is usefull to you
people !
Jimmy Chan   | |2010-04-25 01:18:05
First of all, thanks for the wonderful script, Matt.

I normally use the
"-s" flag to simulate the upgrade or install before actually doing so.
However, the current apt-fast doesn't understand this flag. So I replace the
line in the apt-fast script:

if echo "$@" | grep -q
"upgrade\|install\|dist-upgrade"; then

with this line:

if echo
"$@" | grep -v '\-s' | grep -q
"upgrade\|install\|dist-upgrade"; then

such that it will now
pass the "-s" flag to apt-get correctly.

I also add in my
~/.bash_aliases the following two lines. Now I can use apt-get in the old way
with apt-fast actually doing the work. The first line is necessary since apt-get
requires root privilege.

alias sudo='sudo '
alias apt-get='apt-fast'
RTEK1000  - Im brasilian congratulations!!! (eu sou brasileiro   | |2010-06-04 18:29:42
Very good!!! (muito bom!!!)
RTEK1000  - opss brazilian...not brasilian   | |2010-06-04 18:31:27
Spyzer  - Apt-fast with aria2c support   | |2010-07-02 08:19:37
Hi Matt,
Since I am behind a proxy network with authentication, axel somehow
wasn't working for me and so i changed the script to support aria2c download
accelerator/manager (which ofcourse ran for me in my network). I have mailed u
the script, hope u find it to the best.

Vince  - Aptitude vs apt-get   | |2010-07-26 16:36:36
aptitude seems better than apt-get
is it possible to update apt-fat to use
aptitude instead of apt-get ?
Ron  - apt-fast and aptitude   | |2011-05-08 13:52:20
I've modified the script to use apt-get to download the files and aptitude to
install them. I had to use apt-get to do the downloading because aptitude
doesn't support the --print-uris option.

I also added a section that checks if
aptitude is installed and if not offers to install it.

I'm not actually a
programmer or scripter. I just looked at what was there and did my best to copy
by example on what I saw. There may be horrific mistakes in there, so if someone
can look at it and see if it's okay that would be great.

You can download it

dropfiles okay or should I put it somewhere else?)

If you try it remember to
follow the instructions above about moving it to /usr/bin and taking of the .sh
and making it executable.
Clint  - Return success or failure please   | |2010-10-03 17:35:52
It is possible to write a script using apt-get with an if statement to allow
something to happen if the install succeeded or failed, but with apt-fast it is
not possible.

if sudo apt-get --yes -qq install chromium-browser;
notify-send "Installed" "Chromium" -i
/usr/share/icons/hicolor/scalable/apps/chromium-br owser.svg;
else notify-send
"Failed to install" "Chromium" -i
/usr/share/icons/Humanity/status/48/aptdaemon-dele te.svg; fi
Nathaniel  - Very Fast..,   | |2010-12-27 00:48:04
It's been a long search and now this is it.., A Segmented connection for apt-get
Installation works.., thanks
Aksoy  - How to increase the speed a bit more...   | |2011-03-05 23:07:23
I've seen the script and it's pretty good. I'm currently using it with a few
modifications that I've made. I wanted to let you know how to increase the speed
a bit more. Actually in certain cases it may increase it a lot. In the script,
the line that calls the axel program has only one parameter which is -a. This
makes the program run in a more quite mode. If you add this parameter -n 20 next
to it, it will make the axel download with more connections, in this case 20. If
you don't use it the default is 4 which I believe is quite a small value. Try to
update it with this new parameter, you will see the difference as an overall
Xaekai   | |2011-03-09 17:44:13
#~~ A prefetching
apt-get wrapper. Xaekai's Performance Edition
#~~ Copyright (C) 2011 Xaekai ~ ~ Released under GPLv3
#~~ This program is free software: you can
redistribute it and/or modify it ~~#
#~~ under the terms of the GNU General
Public License as published by the ~~#
#~~ Free Software Foundation, either
version 3 of the License, or (at your ~~#
#~~ option) any later version.
# Originally by ...
Xaekai   | |2011-03-09 17:46:27
Aff.. No previews is kinda fail.
tommis   | |2011-03-19 04:51:17
Could you please create page to launchpad so this could be translated? I can do
finnish translation.
Dudeonyx  - New mod   | |2011-04-09 09:51:31
I've created a mod of the version of apt-fast that uses aria2c . This mod adds
the much needed resume support to apt-get and instead of directly downloading
the deb's to the apt archive folder it downloads them in a temp folder and then
makes symbolic links only to the completed deb's in the /var/cache/apt/archives
The code that links only the completed deb's and ignores incompleted
ones took me a particularly time long to make.(p.s this is from an 18 yr old who
4 weeks ago had never heard of linux,and 2 weeks ago had typed a single command
line) so when i upload it could someone with experience look over the code and
maybe clean it up a bit.
Andres Vidal   | |2011-05-29 15:17:59
Where is your code located? I would like to try it out. .
ubuntu 11.04   | |2011-05-12 10:38:07
I do all this things, but, there is anythings change.
CP  - connection hang   | |2011-07-05 10:19:06
I have just started trying out the script.
Following the instruction above, I
downloaded the
and placed the apt-fast script in
/usr/sbin and installed axel package

Everything works great except I see that
75% of the time the download waits for connection 0 seems to just idle for a
long time before it starts the download. In the mean time connections 1 to 3
blaze through the download process using 90% of the bandwidth.

Is there a step
I am missing somewhere
eddi  - wow   | |2011-07-06 12:14:16
wow, awesome...apt-fast scripts it works, fast better than apt-get. proof
shebaw   | |2011-08-23 08:04:16
tanaka taro   | |2011-10-31 06:52:48
The apt-fast is wonderful

tanaka taro   | |2011-10-31 06:56:44
The apt-fast is wonderful
from:urbanterror_20100418-1~getdeb1_i386.deb to
hiroshima japan
user@user-Aspire-3100:~$ sudo apt-fast install urbanterror
1.8MB/s 10min
tanaka taro   | |2011-10-31 06:57:46
The apt-fast is wonderful

user@user-Aspire-3100:~$ sudo apt-get
install urbanterror 500KB/s 50min
changlianxi  - The apt-fast is wonderful   | |2012-02-19 15:44:17
look that
apt-fast uset  - what change should i do to...   | |2012-02-20 11:30:58
what change should i do to the script so that axel connects to this url: instead of

where is is the url
of the package which is being retreived by apt-fast using axel.
Magomer  - Apt-Fast & 64bit   | |2012-02-25 17:05:35
Hi, i used apt-fast on 32bit without problems but now i wanted to try a 64bit
version and I have problems to install apt-fast.

Can you help me? Thanks =)
thecanadiansandbox  - suggestion: apt-fast total progress bar   | |2012-03-02 16:44:10
Hello, I noticed when using the apt-fast script I get a % progress for every
download, but there is no total progress. I am unsure if this is already
implemented or if it is something that can be simply configured, but I believe
it would be a very good feature to add to the script. A simple total progress
percentage for an entire apt-fast operation.
ericpeamale thingy79  - THANK YOU!   | |2012-04-25 18:32:02
I just installed this on Precise Pangolin fresh install and it's
working great.
First I had to install synaptic and install axel before apt-fast
would work.
I was trying to download a very long list of packages (dpkg
Anonymous   | |2012-04-29 11:41:46
hi,,,when i wan to copy .sh file to bin ,,,give me this error : permission
denied.. Please what do i do????
BostonPeng  - Can we get some dummies instructions?   | |2012-06-30 06:31:39
I saw an article about using apt-fast with Ubuntu on MakeTechEasier and I'd like
to give it a try on Linux Mint Debian Edition. While I'm pretty good at
installing apps form source, and from Git, I'm not sure what files I need and
what needs to be run. Could you explain the process for dummies like me? Thanks.
I look forward to using apt-fast.
Dominique Lasserre   | |2012-06-30 07:37:01
You can use official PPA. Add following line to your sources.list:

deb quantal main

It doesn't
matter if you are not using Ubuntu or Quantal. Everything is written in
scripting languages so apt-fast is portable.
BostonPeng  - PPA on Debian?   | |2012-06-30 07:48:54
Thank you, Matt. It's going to feel really odd putting a PPA in my sources since
I'm one of the people who remind folks that using PPA's on LMDE is a bad idea
since Ubuntu PPA's are generally different enough from how Debian does things
that it can break things. Thanks for making it easier for us non-Ubuntu Debian
users to get apt-fast.
Only registered users can write comments!

3.25 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."


© Matt Parnell's Brain: Plugged In!