|
|
|
apt-fast and Axel: Roughly 26x Faster apt-get Installations and Upgrades |
|
Monday, 02 June 2008 |
Updated 8/4/2010
You can find the latest version at http://www.mattparnell.com/linux/apt-fast/
The latest version will always be the one named "apt-fast.sh." 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.
Current News: I updated the "official" apt-fast.sh with permissions checking, and it runs sudo if you are not root, a contribution by Sergio Silva. I also added a thanks section in the script, which thanks people for submitting thier mods, which I have placed here. I really don't use apt-based distros enough anymore to combine them into one, into the main apt-fast script, but maybe someone who cares more can.
I'd suggest adding an option variable that can be set to axel or aria2c by manual edit, after which is what the script will use for downloading. The same could be done if the user chooses aria2c, allowing to choose a proxy or regular connection. A check to see if aria2c is installed would be needed like the one for axel - and have only one of those run depending on what the downloader variable is set to...
The other stuff shouldn't be hard to roll up into one, like the wonderful autocompletion and install script (though they may vary a bit between distros).
Thanks:
Travis/travisn000 - support for complex apt-get commands Alan Hoffmeister - aria2c support Abhishek Sharma - aria2c with proxy support Richard Klien - Autocompletion, Download Size Checking (made for ubuntu, untested on other distros) Sergio Silva - test to see if axel is installed, root detection/sudo autorun
(in current mainline script) Patrick Ruiz - Suggestions
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.
|
|