ralf@huntington:~$ sudo apt-fast install blender
# Config File
source /etc/apt-fast.conf
+ source /etc/apt-fast.conf
###################################################################
# CONFIGURATION OPTIONS
###################################################################
# Maximum number of connections
_MAXNUM=7
++ _MAXNUM=7
# Use aptitude or apt-fast?
# Note that for outputting the package URI list, we always use apt-get
# ...since aptitude can't do this
_APTMGR=aptitude
++ _APTMGR=aptitude
# Note that the manager you choose has other options - feel free
# to setup your own _DOWNLOADER or customize one of the ones below
# they're simply here as examples, and to provide sane defaults
# Download manager selection
# (choose one by uncommenting one #_DOWNLOADER line)
# aria2c:
#_DOWNLOADER='aria2c -c -j ${_MAXNUM} --input-file=/tmp/apt-fast.list --connect-timeout=600 --timeout=600 -m0'
# aria2c with a proxy (set username, proxy, ip and password!)
#_DOWNLOADER='aria2c -c 20 -j ${_MAXNUM} --http-proxy=http://username:password@proxy_ip:proxy_port -i apt-fast.list'
# axel:
_DOWNLOADER='cat /tmp/apt-fast.list | xargs -l1 axel -n ${_MAXNUM} -a' # axel
++ _DOWNLOADER='cat /tmp/apt-fast.list | xargs -l1 axel -n ${_MAXNUM} -a'
# Check for proper priveliges
[ "`whoami`" = root ] || exec sudo "$0" "$@"
whoami
++ whoami
+ '[' root = root ']'
# Check if a lockfile exists
LCK_FILE=/var/run/$(basename $0).lock
basename $0).lock
basename $0
++ basename /usr/sbin/apt-fast
+ LCK_FILE=/var/run/apt-fast.lock
[ -f $LCK_FILE ] && { echo "$(basename $0) already running"; exit 1; }
+ '[' -f /var/run/apt-fast.lock ']'
# Remove lockfile
LCK_RM() {
rm -f $LCK_FILE
#echo lock-File $LCK_FILE deleted
}
trap "LCK_RM ; exit 1" 2 9 15
+ trap 'LCK_RM ; exit 1' 2 9 15
# Create and insert a PID number to lockfile
echo $$ > $LCK_FILE
+ echo 6869
NUM=1
+ NUM=1
# Make sure one of the download managers is enabled
[ -z "$_DOWNLOADER" ] && echo "You must configure /etc/apt-fast.conf to use axel or aria2c" && LCK_RM && exit 1
+ '[' -z 'cat /tmp/apt-fast.list | xargs -l1 axel -n ${_MAXNUM} -a' ']'
# If the user entered arguments contain upgrade, install, or dist-upgrade
if echo "$@" | grep -q "upgrade\|install\|dist-upgrade|full-upgrade"; then
echo "Working...";
# Test if apt-fast directory is present where we put packages
if [ ! -d /var/cache/apt/archives/apt-fast ] ; then
mkdir /var/cache/apt/archives/apt-fast;
fi
cd /var/cache/apt/archives/apt-fast;
# Get the package URL's
# note aptitude doesn't have this functionality
# so we use apt-get only
apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > /tmp/apt-fast.list
# Download the packages
eval ${_DOWNLOADER}
# Move all packages to the apt install directory by force to ensure
# already existing debs which may be incomplete are replaced
mv -f *.deb /var/cache/apt/archives/
# Install our downloaded packages
${_APTMGR} $@;
echo -e "\nDone! Verify that all packages were installed successfully. If errors are found, run apt-get clean as root and try again using apt-get directly.\n";
else
${_APTMGR} $@;
fi
+ echo install blender
+ grep -q 'upgrade\|install\|dist-upgrade|full-upgrade'
+ echo Working...
Working...
+ '[' '!' -d /var/cache/apt/archives/apt-fast ']'
+ cd /var/cache/apt/archives/apt-fast
+ apt-get -y --print-uris install blender
+ egrep -o -e '(ht|f)tp://[^\'\'']+'
+ eval cat /tmp/apt-fast.list '|' xargs -l1 axel -n '${_MAXNUM}' -a
cat /tmp/apt-fast.list | xargs -l1 axel -n ${_MAXNUM} -a
++ xargs -l1 axel -n 7 -a
++ cat /tmp/apt-fast.list
Aufruf: axel [Optionen] url1 [url2] [url...]
--max-speed=x -s x maximale Geschwindigkeit (Bytes pro Sekunde)
--num-connections=x -n x maximale gleichzeitige Verbindungen
--output=f -o f lokale Ausgabe-Datei
--search=[x] -S [x] Suche nach Spiegelservern und Abruf von x Servern
--header=x -H x Sende HTTP-Header
--user-agent=x -U x Setze Browser-Kennung
--no-proxy -N keinen Proxy-Server benutzen
--quiet -q keine Meldungen auf Standard-Ausgabe
--verbose -v zusätzliche Status-Information
--help -h diese Information
--version -V Versions-Information
Fehler an lintux@lintux.cx melden.
+ mv -f '*.deb' /var/cache/apt/archives/
mv: Aufruf von stat für „*.deb“ nicht möglich: Datei oder Verzeichnis nicht gefunden
+ aptitude install blender
Es werden keine Pakete installiert, aktualisiert oder entfernt.
0 Pakete aktualisiert, 0 zusätzlich installiert, 0 werden entfernt und 4 nicht aktualisiert.
Muss 0 B an Archiven herunterladen. Nach dem Entpacken werden 0 B zusätzlich belegt sein.
+ echo -e '\nDone! Verify that all packages were installed successfully. If errors are found, run apt-get clean as root and try again using apt-get directly.\n'
Done! Verify that all packages were installed successfully. If errors are found, run apt-get clean as root and try again using apt-get directly.
# Test the date of our lockfile
while [ $NUM -le 2 ] ; do
NUM=`expr $NUM + 1`
sleep 2
done
+ '[' 1 -le 2 ']'
expr $NUM + 1
++ expr 1 + 1
+ NUM=2
+ sleep 2
+ '[' 2 -le 2 ']'
expr $NUM + 1
++ expr 2 + 1
+ NUM=3
+ sleep 2
+ '[' 3 -le 2 ']'
# After error or all done remove our lockfile with a PID number
LCK_RM
+ LCK_RM
+ rm -f /var/run/apt-fast.lock
exit 0
+ exit 0