sudo apt-get -y install gcc libssl-dev nettle-dev libgmp-dev libssh2-1-dev libc-ares-dev libxml2-dev zlib1g-dev libsqlite3-dev pkg-config libexpat1-dev libxml2-dev libcppunit-dev autoconf automake autotools-dev autopoint libtool
wget -O "aria2c.tar.bz2" "https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0.tar.bz2" && tar -xf "aria2c.tar.bz2"
tar -xf "aria2-1.34.0.tar.bz2"
bash -c "autoreconf -i && ./configure" && make -j 2
aria2 is primarily written in C. Initially it was written based on C98/C03 standard features. We are now migrating aria2 to C11 standard. The current source code requires C11 aware compiler. Fo well-known compilers, such as g and clang, the
-std=c++0x flag must be supported.
In order to build aria2 from the source package, you need following development packages (package name may vary depending on the distribution you use):
libgnutls-devRequired for HTTPS, BitTorrent, Checksum support
nettle-devRequired for BitTorrent, Checksum support
libgmp-devRequired for BitTorrent
libssh2-1-devRequired for SFTP support
libc-ares-devRequired for async DNS support
libxml2-devRequired for Metalink support
zlib1g-devRequired for gzip, deflate decoding support in HTTP
libsqlite3-devRequired for Firefox3/Chromium cookie support
pkg-configRequired to detect installed libraries
You can use
libgcrypt-dev instead of
libgpg-error-devRequired for BitTorrent, Checksum support
libgcrypt-devRequired for BitTorrent, Checksum support
You can use
libssl-dev instead of
libssl-devRequired for HTTPS, BitTorrent, Checksum support
You can use
libexpat1-dev instead of
On Fedora you need the following packages:
If you downloaded source code from git repository, you have to install following packages to get autoconf macros:
And run following command to generate configure script and other files necessary to build the program:
Also you need Sphinx to build man page.
If you are building aria2 for Mac OS X, take a look at the
make-release-os.mk GNU Make makefile.
The quickest way to build aria2 is first run configure script:
To build statically linked aria2, use
ARIA2_STATIC=yes command-line option:
After configuration is done, run
make to compile the program:
Cross-compiling Windows binary to create a Windows binary.
Cross-compiling Android binary to create an Android binary.
The configure script checks available libraries and enables as many features as possible except for experimental features not enabled by default.
1.1.0, aria2 checks the certificate of HTTPS servers by default. If you build with OpenSSL or the recent version of GnuTLS which has
gnutls_certificate_set_x509_system_trust() function and the library is properly configured to locate the system-wide CA certificates store, aria2 will automatically load those certificates at the startup. If it is not the case, I recommend to supply the path to the CA bundle file. For example, in Debian the path to CA bundle file is
/etc/ssl/certs/ca-certificates.crt (in ca-certificates package). This may vary depending on your distribution. You can give it to configure script using
./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt' make
--with-ca-bundle option, you will encounter the error when accessing HTTPS servers because the certificate cannot be verified without CA bundle. In such case, you can specify the CA bundle file using aria2's
--ca-certificate option. If you don't have CA bundle file installed, then the last resort is disable the certificate validation using
Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation will automatically use the system certificate store, so
--with-ca-bundle is not necessary and will be ignored when using these implementations.
By default, the bash_completion file named
aria2c is installed to the directory
$prefix/share/doc/aria2/bash_completion. To change the install directory of the file, use
make the executable is located at
aria2 uses CppUnit for automated unit testing. To run the unit test: