Aria2 accelerates downloads
GuideAria2 is a free, open-source, lightweight multi-protocol and multi-source command line download tool that supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink protocols, so it brings a lot of convenience to our users.
Aria2 is a free, open-source, lightweight multi-protocol and multi-source command line download tool that supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink protocols; aria2 can be manipulated through built-in JSON-RPC and XML-RPC interfaces. When aria2 downloads an object, it automatically verifies the data block. It can download an object through multiple sources or protocols and will try to use your maximum download bandwidth. By default, all Linux distributions include aria2, so we can install it easily from the official library. Some GUI download managers such as uget use aria2 as plug-ins to increase the download speed.
Aria2 features
- Support for HTTP/HTTPS GET
- Support for HTTP Proxy
- Support for http basic Authentication
- Support for HTTP Proxy Authentication
- Support for FTP (active and passive mode)
- Use the HTTP Proxy FTP (GET command line or tunnel)
- Multipart download
- Supports cookies
- Can run as a daemon.
- Supports fast extended BitTorrent protocol
- Supports selecting files in Multi-file torrent
- Metalink 3.0 (HTTP/FTP/BitTorrent)
- Restrict download and upload speeds
1. Install aria2 in LinuxWe can easily install the aria2 command line download tool on all Linux distributions, such as Debian, Ubuntu, Mint, RHEL, CentOS, Fedora, suse, openSUSE, Arch Linux, Manjaro, Mageia, etc ...... You only need to enter the following command for installation. For CentOS and RHEL systems, we need to enable uget or RPMForge library support.
[For Debian, Ubuntu, and Mint] $ sudo apt-get install aria2 [For CentOS, RHEL, Fedora 21, and earlier operating systems] # yum install aria2 [Fedora 22 and later system] # dnf install aria2 [For suse and openSUSE] # zypper install wget [Mageia] # urpmi aria2 [for Debian, Ubuntu, and Mint] $ sudo pacman-S aria2
2. Download a single fileThe following command downloads an object from the specified URL and stores it in the current directory, we can see the object (date, time, download speed, and download progress ).
# aria2c https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#986c80 19MiB/21MiB(90%) CN:1 DL:3.0MiB]03/22 09:49:13 [NOTICE] Download complete: /opt/owncloud-9.0.0.tar.bz2Download Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================986c80|OK | 3.0MiB/s|/opt/owncloud-9.0.0.tar.bz2Status Legend:(OK):download completed.
3. Save the file with different namesDuring initial download, we can use the-o (lower case) option to use different names when saving the file. Here we will use the owncloud.zip file name to save the file.
# aria2c -o owncloud.zip https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#d31304 16MiB/21MiB(74%) CN:1 DL:6.2MiB]03/22 09:51:02 [NOTICE] Download complete: /opt/owncloud.zipDownload Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================d31304|OK | 7.3MiB/s|/opt/owncloud.zipStatus Legend:(OK):download completed.
4. download speed limitBy default, aria2 uses full bandwidth to download files. Before the file is downloaded, nothing can be done on the server (this will affect the access bandwidth of other services ). Therefore, it is best to use it when downloading large files.
–max-download-limit
To avoid further problems.
# aria2c --max-download-limit=500k https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#7f9fbf 21MiB/21MiB(99%) CN:1 DL:466KiB]03/22 09:54:51 [NOTICE] Download complete: /opt/owncloud-9.0.0.tar.bz2Download Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================7f9fbf|OK | 462KiB/s|/opt/owncloud-9.0.0.tar.bz2Status Legend:(OK):download completed.
5. Download multiple filesThe following command downloads more than one file from the specified location and saves it to the current directory, we can see the object (date, time, download speed, and download progress ).
# aria2c -Z https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2 ftp://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz[DL:1.7MiB][#53533c 272KiB/21MiB(1%)][#b52bb1 768KiB/3.6MiB(20%)]03/22 10:25:54 [NOTICE] Download complete: /opt/wget-1.17.tar.gz[#53533c 18MiB/21MiB(86%) CN:1 DL:3.2MiB]03/22 10:25:59 [NOTICE] Download complete: /opt/owncloud-9.0.0.tar.bz2Download Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================b52bb1|OK | 2.8MiB/s|/opt/wget-1.17.tar.gz53533c|OK | 3.4MiB/s|/opt/owncloud-9.0.0.tar.bz2Status Legend:(OK):download completed.
6. Incomplete downloadWhen you encounter some network connection problems or system problems and want to download a large file (such as an ISO image file), I suggest you use the-c option, it can help us resume unfinished downloads from this status and complete as usual. Otherwise, when you download the file again, it will initialize a new download and save it as a different file name (automatically Add. 1 after the file name ). Note: if there is any interruption, aria2 uses the. aria2 suffix to save (unfinished) the file.
# Aria2c-c listen 8.2MiB/21MiB (38%) CN: 1 DL: 3.1MiB ETA: 4 s] ^ C03/22 10:09:26 [NOTICE] Shutdown sequence commencing... press Ctrl-C again for emergency shutdown.03/22 10:09:26 [NOTICE] Download GID # db0b08bf55d5908d not complete:/opt/owncloud-9.0.0.tar.bz2Download Results: gid | stat | avg speed | path/URI ================================ ======== ========================================================== = Db0b08 | INPR | 3.3MiB/s |/opt/owncloud-9.0.0.tar.bz2Status Legend :( INPR): download in-progress. if you restart the transmission, aria2 resumes download. # Aria2c-c prepare 21MiB/21MiB (98%) CN: 1 DL: 2.7MiB] 03/22 10:09:57 [NOTICE] Download complete:/opt/owncloud-9.0.0.tar.bz2Download Results: gid | stat | avg speed | path/URI ================================ ========================================================== ========= 873d08 | OK | 1.9MiB/s |/opt/owncloud-9.0.0.tar.bz2Status Legend :( OK): download completed.
7. get input from FileJust as wget can download the input URL list from a file. We need to create a file and store each URL in a separate row. You can add the-I option to the ara2 command line to perform this operation.
# aria2c -i test-aria2.txt[DL:3.9MiB][#b97984 192KiB/21MiB(0%)][#673c8e 2.5MiB/3.6MiB(69%)]03/22 10:14:22 [NOTICE] Download complete: /opt/wget-1.17.tar.gz[#b97984 19MiB/21MiB(90%) CN:1 DL:2.5MiB]03/22 10:14:30 [NOTICE] Download complete: /opt/owncloud-9.0.0.tar.bz2Download Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================673c8e|OK | 4.3MiB/s|/opt/wget-1.17.tar.gzb97984|OK | 2.5MiB/s|/opt/owncloud-9.0.0.tar.bz2Status Legend:(OK):download completed.
8. Each host uses two connections for download.By default, the maximum number of connections to one server is downloaded each time. Only one host can be created. We can use the aria2 command line to add-x2 (2 indicates two connections) to create multiple connections to each host to speed up download.
# aria2c -x2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#ddd4cd 18MiB/21MiB(83%) CN:1 DL:5.0MiB]03/22 10:16:27 [NOTICE] Download complete: /opt/owncloud-9.0.0.tar.bz2Download Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================ddd4cd|OK | 5.5MiB/s|/opt/owncloud-9.0.0.tar.bz2Status Legend:(OK):download completed.
9. Download the BitTorrent seed fileWe can use the aria2 command line to directly download a BitTorrent seed file:
# aria2c https://torcache.net/torrent/C86F4E743253E0EBF3090CCFFCC9B56FA38451A3.torrent?title=[kat.cr]irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr[#388321 0B/0B CN:1 DL:0B] 03/22 20:06:14 [NOTICE] Download complete: /opt/[kat.cr]irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr.torrent03/22 20:06:14 [ERROR] Exception caughtException: [BtPostDownloadHandler.cc:98] errorCode=25 Could not parse BitTorrent metainfoDownload Results:gid |stat|avg speed |path/URI======+====+===========+=======================================================388321|OK | 11MiB/s|/opt/[kat.cr]irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr.torrentStatus Legend:(OK):download completed.
10. Download the BitTorrent magnetic LinkUsing aria2, we can also directly download a seed file through the BitTorrent magnetic link:
# aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'
11. Download BitTorrent Metalink SeedsYou can also directly download a Metalink file through the aria2 command line.
# aria2c https://curl.haxx.se/metalink.cgi?curl=tar.bz2
12. Download an object from a password-protected websiteAlternatively, we can download an object from a password-protected website. The following command line downloads files from a password-protected website.
# aria2c --http-user=xxx --http-password=xxx https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2# aria2c --ftp-user=xxx --ftp-password=xxx ftp://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz
13. Read