|
apt-fast and Axel: Roughly 26x Faster apt-get Installations and Upgrades |
|
Monday, 02 June 2008 |
Updated 12/17/2009
Since apt-fast has gotten popular due to acolades in the Ubuntu community and from mention in Linux Format, I've gotten lots of hits, and a few bugs. I believe that apt-fast is now golden, though, thanks to travisn000 on the PCLinuxOS forums. From now on, you can find the latest version "source" (it's just a shellscript) at http://www.mattparnell.com/linux/apt-fast/ ... the latest version will always be the one named "apt-fast.sh."
Yes, this will work for any distro that uses apt-get, and the concept should work most of the others...it may even be as simple as removing wget and replacing it with a symlink to axel. Since I last updated this post, I have started using Archlinux, whose package manager has a system in place that allows any download manager to be used, for example.
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 the axel download accelerator installed, 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, huh?
To do this, you first need to download and install the axel download accelerator. It is really a good drop-in replacement for wget, as it is bash based. Once installed, we are ready to setup apt-fast. On K/Ubuntu apt-get install axel should do it.
Then, either find a package somewhere (or install it from a repo if one of them has it), or just download the latest apt-fast source from the link mentioned at the top of this post. Then, just place the script somewhere (/usr/bin or /usr/sbin is ideal), rename it to apt-fast (without the .sh extension), and sudo chmod +x apt-fast.
Once done, just 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, 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 mattparnell.com.
|