Difference between revisions of "Aria2"

From ArchWiki
Jump to: navigation, search
(Option Details)
Line 105: Line 105:
 
; <tt>dir=/file/Downloads</tt>: Store the downloaded file(s) in {{Filename|/file/Downloads}}.
 
; <tt>dir=/file/Downloads</tt>: Store the downloaded file(s) in {{Filename|/file/Downloads}}.
 
; <tt>file-allocation=falloc</tt>: Call [http://www.kernel.org/doc/man-pages/online/pages/man2/fallocate.2.html posix_fallocate()] to allocate disk space before downloading begins. (Default: prealloc)  
 
; <tt>file-allocation=falloc</tt>: Call [http://www.kernel.org/doc/man-pages/online/pages/man2/fallocate.2.html posix_fallocate()] to allocate disk space before downloading begins. (Default: prealloc)  
; <tt>enable-http-pipelining=true</tt>: Enable [[Wikipedia:HTTP_Pipelining|HTTP/1.1 pipelining]] to overcome network latency and to reduce network load.
+
; <tt>enable-http-pipelining=true</tt>: Enable [[Wikipedia:HTTP_Pipelining|HTTP/1.1 pipelining]] to overcome network latency and to reduce network load. (Default: false)
; <tt>input-file=/file/input.rapidshare: Download a list of single line of TAB separated URIs found in {{Filename|/file/input.rapidshare}}
+
; <tt>input-file=/file/input.rapidshare</tt>: Download a list of single line of TAB separated URIs found in {{Filename|/file/input.rapidshare}}
 
; <tt>log-level=error</tt>: Set log level to output errors only. (Default: debug)
 
; <tt>log-level=error</tt>: Set log level to output errors only. (Default: debug)
 
; <tt>max-connection-per-server=2</tt>: Set a maximum of two (2) connections to each server per file. (Default: 1)
 
; <tt>max-connection-per-server=2</tt>: Set a maximum of two (2) connections to each server per file. (Default: 1)
Line 118: Line 118:
 
  total 128M
 
  total 128M
 
  -rw------- 1 arch users  167 Aug 20 00:00 aria2.rapidshare
 
  -rw------- 1 arch users  167 Aug 20 00:00 aria2.rapidshare
 +
 +
* <b><sup>2</sup></b>
  
 
{{Tip|The example configuration file can also be applied to [http://www.hotfile.com/ Hotfile], [http://depositfiles.com/ DepositFiles], et.al.|}}
 
{{Tip|The example configuration file can also be applied to [http://www.hotfile.com/ Hotfile], [http://depositfiles.com/ DepositFiles], et.al.|}}

Revision as of 01:05, 26 August 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Introduction

aria2 is lightweight, command-line download manager featuring support for HTTP/HTTPS, FTP, BitTorrent and Metalink protocols. aria2 is generally regarded as one of the lightest and fastest download managers available and across multiple platforms. Some of the more outstanding features of aria2 include great flexibility of layout through the use of numerous options and configuration files and a built-in XML-RPC management interface.

Installation

Template:Package Official is part of the official Arch Linux [extra] repository.

$ pacman -Si aria2
Repository     : extra
Name           : aria2
Version        : 1.10.0-1
URL            : http://aria2.sourceforge.net/
Licenses       : GPL
Groups         : None
Provides       : None
Depends On     : gnutls  libxml2  sqlite3  c-ares  ca-certificates
Optional Deps  : None
Conflicts With : None
Replaces       : None
Download Size  : 981.56 K
Installed Size : 4392.00 K
Packager       : Daniel J Griffiths <ghost1227@archlinux.us>
Architecture   : x86_64
Build Date     : Mon 16 Aug 2010 09:53:21 PM PDT
MD5 Sum        : b15758227506df9fc8c81b8493a6a7d1
Description    : Download utility that supports HTTP(S), FTP, BitTorrent, and
                 Metalink

Download and install aria2 and its dependencies:

# pacman -S aria2

Execution

The executable name for the aria2 package is aria2c. This legacy naming convention has been retained for backwards compatibility.

Configuration

aria2.conf

aria2 looks to Template:Filename for a set of global configuration options by default. This behavior can be modified with the --conf-path switch:

$ aria2c --conf-path=/file/aria2.options http://rapidshare.com/files/12345678/aria2.example.rar

If Template:Filename exists and the options specified in Template:Filename are desired, the --no-conf switch must be appended to the command:

$ aria2c --no-conf --conf-path=/file/aria2.rapidshare http://rapidshare.com/files/12345678/aria2.example.rar

If Template:Filename does not yet exist and you wish to simplify the management of configuration options:

$ touch ~/.aria2/aria2.conf

Example .bash_alias

alias down='aria2c --conf-path=${HOME}/.aria2/aria2.conf'
alias rapid='aria2c --conf-path=/file/aria2.rapidshare'

Example aria2.conf

continue
dir=${HOME}/Desktop
file-allocation=none
input-file=${HOME}/.aria2/input.conf
log-level=warn
max-connection-per-server=4
min-split-size=5M
on-download-complete=exit

This is essentially the same as if running the following:

$ aria2c dir=~/home/USER_NAME/Desktop file-allocation=none input-file=~/home/USER_NAME/.aria2/input.conf on-download-complete=exit log-level=warn FILE

Option Details

continue
Continue downloading a partially downloaded file if a corresponding control file exists.
dir=${HOME}/Desktop
Store the downloaded file(s) in Template:Filename.
file-allocation=none
Do not pre-allocate disk space before downloading begins. (Default: prealloc) 1
input-file=${HOME}/.aria2/input.conf
Download a list of single line of TAB separated URIs found in Template:Filename
log-level=warn
Set log level to output warnings and errors only. (Default: debug)
max-connection-per-server=4
Set a maximum of four (4) connections to each server per file. (Default: 1)
min-split-size=5M
Only split the file if the size is larger than 2*5MB = 10MB. (Default: 20M)
on-download-complete=exit
Run the exit command and exit the shell once the download session is complete.

Additional Notes

1 --file-allocation=falloc
Recommended for newer file systems such as ext4 (with extents support), btrfs or xfs as it allocates large files (GB) almost instantly. Do not use falloc with legacy file systems such as ext3 as prealloc consumes approximately the same amount of time as standard allocation would while locking the aria2 process from proceeding to download.
Tip: See aria2c -help#all and the aria2 man page for a complete list of configuration options.
)

Example aria2.rapidshare

http-user=USER_NAME
http-passwd=PASSWORD
allow-overwrite=true
dir=/file/Downloads
file-allocation=falloc
enable-http-pipelining=true
input-file=/file/input.rapidshare
log-level=error
max-connection-per-server=2
summary-interval=120

Option Details

http-user=USER_NAME
Set HTTP username as USER_NAME for password-protected logins. This affects all URIs.
http-passwd=PASSWORD
Set HTTP username as PASSWORD for password-protected logins. This affects all URIs.
allow-overwrite=true
Restart download if a corresponding control file does not exist. (Default: false)
dir=/file/Downloads
Store the downloaded file(s) in Template:Filename.
file-allocation=falloc
Call posix_fallocate() to allocate disk space before downloading begins. (Default: prealloc)
enable-http-pipelining=true
Enable HTTP/1.1 pipelining to overcome network latency and to reduce network load. (Default: false)
input-file=/file/input.rapidshare
Download a list of single line of TAB separated URIs found in Template:Filename
log-level=error
Set log level to output errors only. (Default: debug)
max-connection-per-server=2
Set a maximum of two (2) connections to each server per file. (Default: 1)
summary-interval=120
Output download progress summary every 120 seconds. (Default: 60) 2
  • Because Template:Filename the contains a username and password, it is advisable to set permissions on the file to 600, or similar.
arch ~ $ cd /file
arch /file  $ chmod 600 /file/aria2.rapidshare
arch /file $ ls -l
total 128M
-rw------- 1 arch users  167 Aug 20 00:00 aria2.rapidshare
  • 2
Tip: The example configuration file can also be applied to Hotfile, DepositFiles, et.al.
Note: Command-line options always take precedence over options listed in a configuration file.

Useful Tips & Tricks

pacman XferCommand

aria2c can be used as the default download manager for the pacman package manager. See the [ArchWiki] article Improve Pacman Performance for additional details.

Custom Minimal Build

Gains in application response can be gleaned by removing unused features and protocols. Further gains can be accomplished by removing support for external libraries with a custom build. The following example creates an Template:Filename executable with HTTP/HTTPS and FTP download support only. See the Arch Build System page for further details.

Minimal PKGBUILD Example

pkgname=aria2
pkgver=1.10.0
pkgrel=100
pkgdesc="Download utility that supports HTTP(S), FTP, BitTorrent, and Metalink"
arch=('i686' 'x86_64')
url="http://aria2.sourceforge.net/"
license=('GPL')
depends=('c-ares' 'gnutls' 'zlib' 'ca-certificates')
depends=('gnutls' 'libxml2' 'sqlite3' 'c-ares' 'ca-certificates')
source=(http://downloads.sourceforge.net/aria2/aria2-${pkgver}.tar.bz2)
md5sums=('1386df9b2003f42695062a0e1232e488')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

 ./configure --enable-bittorrent --disable-metalink --enable-epoll \
 --disable-dependency-tracking --disable-xmltest --disable-nls \
 --without-sqlite3 --without-libxml2 --without-libexpat \
 --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt --prefix=/usr

 make
}

package() {
	cd ${srcdir}/${pkgname}-${pkgver}
	make DESTDIR=${pkgdir} install
}

Package Removal

To remove the package while retaining its configuration files and dependencies:

# pacman -R aria2

To remove the aria2 package and its configuration files while retaining its dependencies:

# pacman -Rn aria2

To remove the aria2 package and dependencies not required by any other packages while retaining its configuration files:

# pacman -Rs aria2

To remove the aria2 package, its configuration files and dependencies not required by any other packages:

# pacman -Rns aria2

{{Box Note|Pacman will not remove configuration files outside of the defaults that were created during package installation. This includes Template:Filename

Additional Resources