Aria2 – A Multi-Protocol Command-Line Download Tool for Linux

Aria2 is an open source and free lightweight multi-protocol & multi-server command-line download utility for Windows, Linux and Mac OSX.

It has an ability to download files from multiple protocols and sources including HTTP/HTTPS, FTP, BitTorrent and Metalink. It improves download speed by utilizing maximum download bandwidth and speeds up your download experience.

Features

  • Multi-Connection Download – It can download a file from multiple sources/protocols and attempt to use your maximum download bandwidth and improve overall download experience.
  • Lightweight – It doesn’t take much memory and CPU utilization. The HTTP/FTP downloads use only 4MB memory and 9MB for BitTorrent downloads.
  • Fully Featured BitTorrent Client – A fully featured BitTorrent client with support for DHT, PEX, Encryption, Magnet URI, Web-Seeding, Selective Downloads, Local Peer Discovery and UDP tracker.
  • Metalink Enabled – It supports Metalink version 4 and 3, which provides the file verification for HTTP/FTP/SFTP/BitTorrent integration and the different configurations for location, language, OS, etc.
  • Remote Control – A RPC interface support to control the aria2 process. The supported interfaces are JSON-RPC (over HTTP and WebSocket) and XML-RPC.

Please note, we should not consider aria2 is a replacement of wget, curl or torrent clients, but rather considered as an alternative with more support and download options.

Installing Aria2 Command-Line Download Manager in Linx

This article explains how to install Aria2 command-line download utility in RHEL, CentOS, Fedora and Debian, Ubuntu, Linux Mint systems with some useful download techniques and usage.

On RHEL/CentOS/Fedora

First, you need to download and enable the EPEL repository under RHEL/CentOS systems. (Note: Fedora users don’t need to add any repository, simply install aria2 using dnf command as shown).

# dnf install aria2

Now install Aria2 package from the enabled EPEL repository under your system using YUM command tool.

# yum install epel-release -y
# yum install aria2 -y
Sample Output :
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.estointernet.in
 * elrepo: mirror-hk.koddos.net
 * epel: repos.del.extreme-ix.org
 * extras: centos.mirrors.estointernet.in
 * updates: centos.mirrors.estointernet.in
Resolving Dependencies
--> Running transaction check
---> Package aria2.x86_64 0:1.18.10-2.el7.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================
 Package                                         Arch               Version                Repository           Size
==========================================================================================================================
Installing:
 aria2                                           x86_64             1.18.10-2.el7.1        epel                 1.3 M

Transaction Summary
==========================================================================================================================
Install  1 Package

Total download size: 1.3 M
Installed size: 4.1 M
Downloading packages:
aria2-1.18.10-2.el7.1.x86_64.rpm                                                                        | 1.3 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : aria2-1.18.10-2.el7.1.x86_64                                                             1/1 
  Verifying  : aria2-1.18.10-2.el7.1.x86_64                                                             1/1 
Installed:
  aria2.x86_64 0:1.18.10-2.el7.1

Complete!

On Debian/Ubuntu/Linux Mint

$ sudo apt-get install aria2
Sample Output
ravisaive@ravisaive-OptiPlex-380:~$  sudo apt-get install aria2
[sudo] password for ravisaive: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  ksysguardd libruby1.9.1 ruby1.9.1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libc-ares2
The following NEW packages will be installed:
  aria2 libc-ares2
0 upgraded, 2 newly installed, 0 to remove and 234 not upgraded.
10 not fully installed or removed.
Need to get 1,651 kB of archives.
After this operation, 4,536 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in.archive.ubuntu.com/ubuntu/ saucy/main libc-ares2 i386 1.10.0-2 [38.3 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu/ saucy/universe aria2 i386 1.17.0-1 [1,613 kB]
Fetched 1,651 kB in 7s (235 kB/s)

Note: Sometimes, the default repositories don’t provide the latest version. So, in that case you might need to compile and install it from the source package as shown here.

Aria2 Download Usage & Examples

Here we will explore some of useful aria2 download usage and options with their examples.

Download from WEB

To download a single file from the web, execute the command as.

# aria2c http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso
Download from Two sources

To download multiple files, say two files, then run the following command.

# aria2c http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso http://releases.ubuntu.com/cosmic/ubuntu-18.10-desktop-amd64.iso
Download using Two connections

To download file using only two connections per host, then use the option -x2 (connection 2) as shown below.

# aria2c -x2 http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso
Download from BitTorrent

To download torrent file use the following command.

# aria2c http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso.torrent
Download from Metalink

To download a metalink file, use the following command.

$ aria2c http://example.org/mylinux.metalink
Download URLs found in a text file

To download a list of URL’s written in a text file called downloadurls.txt, then use the following command. The URL‘s should contain one download per line in a downloadurls.txt file.

# aria2c -i downloadurls.txt
Set Download Speed Limit

To set a download speed limit per download, use the following option.

# aria2c –max-download-limit=100K http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso.torrent

For more usage and options, open a terminal and run the command as “man aria2c“. There are also graphical front-ends available for Aria2, you can find them at aria2 page.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

1 Comment

Leave a Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.