How to Download Files Using Aria2

Channel: Linux
Abstract: use the dnf package manager just as in RHEL 8/ CentOS 8 $ sudo dnf install aria2 Arch / Manjaro Linux For Arch Linux & its derivatives use the Pacman

Aria2 is a free and open-source lightweight multi-protocol command-line utility that grabs files from the internet. It supports a variety of protocols such as HTTP, HTTPS, FTP, and even BitTorrent. Aria2 works on windows, Linux, and Mac OSX.

In this guide, you will learn how to install and use Aria2 on Linux.

Key Features

Below is a highlight of the key features of Aria2 download utility:

Download Multiple Files (or ULRs) i...

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

Download Multiple Files (or ULRs) in Parallel with Python

1) Resource-friendly: Aria2 is quite lightweight and takes up just a small fraction of your RAM and CPU. Physical memory usage is roughly 4MB for normal FTP/HTTP downloads ad 9MB for BitTorrent downloads.

2) Multi-Connection Download: Aria2 is a multi-protocol download tool that supports multiple protocols and tries as much as possible to use maximum bandwidth to speed up your downloads

3) Remote Control: Aria2 has support for RPC interface, more specifically JSON-RPC and XML-RPC.

4) Fully-featured BitTorrent features: These include Web seeding, Magnet URI, Encryption, Selective downloads and Local Peer discovery to mention a few.

5) Metalink support: 

Installing Aria2 on Linux

Before we touch base on how Aria2 works, let see how to install it on various Linux distributions:

Install Aria2 using Snap

This is the most recommended way of installing Aria2 on various Linux distros for the simple reason that snap packages are universal and work in almost any major Linux flavor.

Before anything else, ensure that snapd is installed.

To install Aria2 using snap, run the command below:

$ sudo snap install aria2c

Apart from using snap packages, you can use the package managers in various Linux distributions as follows

Ubuntu/Debian/Mint

On Ubuntu, use the APT package manager as follows:

$ sudo apt install aria2
RHEL 8/CentOS 8

For  RHEL 8 /CentOS 8, use the dnf package manager as shown:

$ sudo dnf install aria2

For RHEL 7/CentOS 7 and earlier versions, use the yum package manager.

$ sudo yum install aria2
Fedora 22 and later versions

For  Fedora 22, use the dnf package manager just as in RHEL 8/ CentOS 8

$ sudo dnf install aria2
Arch  / Manjaro Linux

For Arch Linux & its derivatives use the Pacman package manager as shown:

$ sudo pacman -S aria2
How to use Aria2 with example

In this section, we look at a few usages of the Aria2 command-line tool.

1) Download a single file over the internet

To download a file using either HTTP, HTTPS or FTP protocol, use the syntax:

$ aria2c  file-url

For example, to download the latest WordPress tarball file, run the command:

$ aria2c https://wordpress.org/latest.tar.gz
aria2 download a file 2 ) Save a file under a different name after downloading

To save a file using your preferred name and format pass the -o option as shown:

$ aria2c -o  new-filename  file-url

For example, to save the latest WordPress file as latest-wordpress.zip run the command:

$ aria2c -o latest-wordpress.zip  https://wordpress.org/latest.tar.gz
Save a file under a different name 3) Download  multiple files

To download more than one file, use the -Z  option in the command followed the URLs of the files to be downloaded as shown.

Here, we are downloading the latest Teamviewer Debian package and Owncloud tarball file.

$ aria2c -Z https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
 https://download.owncloud.org/community/owncloud-10.5.0.tar.bz2
aria2 download many files 4) Download  files from an input file

Instead of listing all the file URLs on the terminal, you can create a text file in which you can list all the file URLs.  You can then run the command using the -i option and passing the input file as shown.

$ aria2c -i aria2-input.txt
aria2c download files saved in a text file 5) Limit download bandwidth speed

By default, aria2 uses the maximum bandwidth to download files. This can result to degraded performance if you intend to upload or download files using other applications. To avoid this scenario, you can limit the bandwidth using the -max-download-limit option a shown:

$ aria2 --max-download-limit=500k  https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
6) Download a Torrent file

To download a torrent file, run the command using the torrent link as shown:

$ aria2c http://releases.ubuntu.com/disco/ubuntu-19.04-desktop-amd64.iso.torrent
Download a torrent file

Finally, for more command options, visit the man pages as shown:

$ man aria2c
Conclusion

Wget still remains in memory for everyone and the default utility in most Linux distributions. Like Curl, aria2 supports a number of protocols that make it better.

If you having difficulties grabbing files over the internet, aria2 is a good download utility.

Ref From: linoxide
Channels:

Related articles