| by Arround The Web | No comments

aria2 – A Command Line Download Tool for Linux

“The aria2 is an open-source Linux command-line tool for downloading files using different protocols, such as FTP, HTTP/HTTPS, BitTorrent, SFTP, and Metalink. This multi-protocol download tool doesn’t come preinstalled like wget or curl, but it ranks best in efficiency and ease of use.

If you’ve not used aria2 before, keep reading this guide to understand what aria2 is and its usage examples.”

Why Use aria2?

aria2 stands out above the other command-line download tools for its incredible features:

  • Lightweight – aria2 is resource-friendly and only consumes a minute fraction of your RAM.
  • Multi-source – with aria2, you can add more than one download source for your file, giving the tool a better download experience.
  • Remote control – the XML and JSON RPC interfaces are supported by aria2, which gives control of the process.
  • aria2 offers support for HTTP proxy authentication.

How to Install aria2?

Most distros support aria2 as it is available in the packager manager, and in this guide, we will discuss how to install aria2 in Linux systems.

For Ubuntu, and Linux Mint systems, use the command:

$ sudo apt-get install aria2

To install it on Red Hat, CentOS, and Fedora:

$ sudo dnf install aria2

For Arch Linux and Manjaro, use the command:

$ sudo pacman -S aria2

Using aria2 in Linux to Download Files

As we noted earlier, aria2 is a complete download tool that supports all protocols. Some of its usage examples are discussed below. They are easy to learn, and you will soon get addicted to using the command line for your downloads. Let’s get started!

1. Using aria2 to Download Single Files From the WEB

For downloading files, aria2 uses the aria2c command. You only need the download URL of your target file, and you can quickly download the file. The basic syntax is:

$ aria2c [URL-of-file-to-download]

Once the download starts, you can use the ctrl+ c combination to cancel it. Doing so is like pausing the download, and if you need to resume it, you only need to repeat the command, and it will continue from where you canceled it.

Download From HTTPS

In this case, we will download a PDF file.

$ aria2c https://www.googleguide.com/print/adv_op_ref.pdf


The PDF will download, and from the output below, you can note it gives the path where the downloaded file gets stored. It’s that easy!

You can use the same format to download from an HTTP source.

Download Using FTP

Here we will try downloading Oracle VM Virtual Box using FTP protocol:

$ aria2c https://download.virtualbox.org/virtualbox/6.1.34/virtualbox-6.1_6.1.34-150636.1~Ubuntu~bionic_amd64.deb


You can note in the output that the file was downloading, but I interrupted it using the ctrl+ c combination, but that’s how you can use aria2 with FTP.

Downloading a Torrent

Two options are available for downloading torrent files. You can either download the torrent file before downloading the data or directly download the data without downloading the torrent file first.

In our example, we will download the torrent file for ubuntu iso.

To download the torrent alongside its data, use the command:

$ aria2c https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso.torrent


To directly download the data, add the –follow-torrent=mem option to the command:

$ aria2c –follow-torrent=mem https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso.torrent

Downloading From Metalink

Metalinks contain files with multiple data sources, and you can effortlessly download them using aria2. The syntax is:

$ aria2c http://file.com/filename.metalink

2. Download From Multiple Sources

When using aria2, you can add different download sources, speeding the download. This feature is helpful when downloading files with multiple mirrors.

The syntax is:

$ aria2c url1 url2

With the two URLs specified, aria2 will use the one that’s fastest for download.

3. Downloading URLs in a Text File Using aria2

Suppose you have a list of URLs that you need to download stored in a file. Pass the filename to aria2. However, ensure each URL is on a single line for it to work.

In our example, we have a multiurl.txt file with two URLs to download two PDFs.


To download the URLs, use the command below:

$ aria2c -i multiurl.txt

From the output, you can note that the download for the two files completes as expected.

4. Use Multiple Connections for Download

You can set the number of connections per host for the download. To do so, add -x2. Here, 2 is the number of connections, and you can use any number. If we need to use two connections to download our earlier URLs, the command will change to:

$ aria2c -x2 -i multiurl.txt

The output will be:

5. Limit Download Speed

With aria2, you can limit the bandwidth used for the download, which is helpful if you have a slow network. To do so, use the –max-download-limit=[limit] option. We will try to download a PDF using HTTPS and limit the bandwidth to 100K.

$ aria2c --max-download-limit=100K https://www.gnu.org/software/bash/manual/bash.pdf

6. Change the Name of the Downloaded File

You can save the file with any name of your choice. All you need is to add the -o flag to the syntax followed by the name to save it with, as shown below:

$ aria2c -o sampledownload https://www.googleguide.com/print/adv_op_ref.pdf


From the output above, you can note that we saved the PDF with a different name, and even when we list the contents of the directory, we can see the PDF saved as sampledownload, as we specified in the syntax.

Final Word

Using aria2 in Linux for downloading files is fantastic. The tool supports all protocols, and it is easy and convenient to use. Never limit your possibilities when using Linux. That said, enjoy using aria2 for your downloads. You will love it!

Share Button

Source: linuxhint.com

Leave a Reply