apt-fast 1.8
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.
Table of Contents
Installation
sudo add-apt-repository ppa:apt-fast/stable
sudo apt-get update
sudo apt-get -y install apt-fastUbuntu PPA
You can use the Ubuntu PPA to get a graphical configuration file setup and automatic updates, for details see:
Some distros, such as PCLinuxOS include apt-fast in their repos.
Quick Install
You can quickly install apt-fast by running:
/bin/bash -c "$(curl -sL https://git.io/vokNn)"Manual
A manual install can be performed as such:
cp apt-fast /usr/local/sbin/
chmod +x /usr/local/sbin/apt-fast
cp apt-fast.conf /etcYou need to have aria2c installed:
apt-get install aria2Then simply run apt-fast instead of apt-get or aptitude.
Autocompletion
Bash
cp completions/bash/apt-fast /etc/bash_completion.d/
chown root:root /etc/bash_completion.d/apt-fast
. /etc/bash_completionZsh
cp completions/zsh/_apt-fast /usr/share/zsh/functions/Completion/Debian/
chown root:root /usr/share/zsh/functions/Completion/Debian/_apt-fast
source /usr/share/zsh/functions/Completion/Debian/_apt-fastMan page installation
mkdir -p /usr/local/share/man/man8/
cp ./man/apt-fast.8 /usr/local/share/man/man8
gzip -f9 /usr/local/share/man/man8/apt-fast.8
mkdir -p /usr/local/share/man/man5/
cp ./man/apt-fast.conf.5 /usr/local/share/man/man5
gzip -f9 /usr/local/share/man/man5/apt-fast.conf.5Configuration
The apt-fast configuration file is located at: /etc/apt-fast.conf
Package manager
_APTMGR=apt-getChange package manager used for installation. Supported are apt-get, aptitude, apt.
Confirmation dialog
DOWNLOADBEFORE=trueTo suppress apt-fast confirmation dialog and download packages directly set this to any value. To ask for confirmation, leave empty. This options doesn't affect package manager confirmation.
Multiple mirrors
Adding multiple mirrors will further speed up downloads and distribute load, be sure to add mirrors near to your location. Official mirror lists:
Then add them to whitespace and comma separated list in config file, e.g.:
MIRRORS=( 'http://ftp.debian.org/debian, http://ftp2.de.debian.org/debian, http://ftp.de.debian.org/debian, ftp://ftp.uni-kl.de/debian' )MIRRORS=( 'http://archive.ubuntu.com/ubuntu, http://de.archive.ubuntu.com/ubuntu, http://ftp.halifax.rwth-aachen.de/ubuntu, http://ftp.uni-kl.de/pub/linux/ubuntu, http://mirror.informatik.uni-mannheim.de/pub/linux/distributions/ubuntu/' )NOTE: To use any mirrors you may have in sources.list or sources.list.d you will need to add them to the apt-fast.conf mirror list.
Maximum connections
_MAXNUM=5Set to maximum number of connections aria2c uses.
Maximum connections per server
_MAXCONPERSRV=10Set to maximum number of connections per server aria2c uses.
Maximum connections per file
_SPLITCON=8Set to maximum number of connections per file aria2c uses.
File split size
_MINSPLITSZ=1MSet to size of each split piece. Possible values: 1M-1024M
Piece selection algorithm
_PIECEALGO=defaultSet to piece selection algorithm to use. Possible values: default, inorder, geom
Downloadmanager file
DLLIST='/tmp/apt-fast.list'Location of aria2c input file, used to download the packages with options and checksums.
Downloadmanager command
_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} -i ${DLLIST} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --connect-timeout=600 --timeout=600 -m0'Change the download manager or add additional options to aria2c.
Proxy
_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --http-proxy=http://username:password@proxy_ip:proxy_port -i ${DLLIST}'To use apt-fast behind a proxy, use --http-proxy option of aria2c and set username, password and proxy_port accordingly.
Download folder
DLDIR='/var/cache/apt/archives/apt-fast'Directory where apt-fast downloads the packages.
APT archives cache
APTCACHE='/var/cache/apt/archives'Directory where apt-get and aptitude download packages.
Verbose output
VERBOSE_OUTPUT=yShow aria2 download file instead of package listing before download confirmation. Unset to show package listing.
Colors
cGreen='\e[0;32m'
cRed='\e[0;31m'
cBlue='\e[0;34m'
endColor='\e[0m' Terminal colors used for dialogs. Refer to ANSI Escape sequences for a list of possible values. Disabled when not using terminal.
License
Consider apt-fast and all of its derivatives licensed under the GNU GPLv3+.
Copyright: 2008-2012 Matt Parnell, http://www.mattparnell.com Improvements, maintenance, revisions - 2012 Dominique Lasserre
Special thanks
- Travis/travisn000 - support for complex apt-get commands
- Alan Hoffmeister - aria2c support
- Abhishek Sharma - aria2c with proxy support
- Luca Marchetti - improvements on the locking system and downloader execution
- Richard Klien - Autocompletion, Download Size Checking (made for on ubuntu, untested on other distros)
- Patrick Kramer Ruiz - suggestions
- Sergio Silva - test to see if axel is installed, root detection/sudo autorun, lock file check/creation
- Waldemar {BOB}{Burnfaker} Wetzel - lockfile improvements, separate config file
- maclarke - locking improvements