How to Start aria2 Download with Local Metalink File?

This article provides a quick overview and step-by-step guide on how to use a locally saved Metalink file to initiate a download using the aria2 command-line utility. You will learn the exact command syntax, how aria2 processes Metalink files to optimize download speeds, and a few advanced options to customize your download behavior.

A Metalink file (.metalink or .meta4) is an XML-formatted file that contains metadata about a download. Instead of pointing to a single file on a single server, a Metalink file lists multiple sources (mirrors, BitTorrent torrents, and cryptographic checksums) for the same file. When you feed this file to aria2, the utility automatically downloads segments of the file from different sources simultaneously, maximizing your bandwidth and ensuring file integrity.

The Command Syntax

To start a download using a local Metalink file, you need to open your terminal or command prompt and pass the path of the .metalink file directly to the aria2c command.

The basic command structure is as follows:

aria2c /path/to/your/file.metalink

If you are already inside the directory where your Metalink file is saved, you can simply run:

aria2c example.metalink

While the default command works perfectly for most scenarios, aria2 offers specific flags to give you more control over how the Metalink file is handled.

aria2c -d /path/to/download/folder example.metalink
aria2c --select-file=1,3 example.metalink
aria2c --metalink-enable-unique-protocol=false example.metalink

Error Troubleshooting

If aria2 fails to parse your file, ensure that the file is not corrupted and follows proper XML formatting. Additionally, verify that your terminal has the correct read permissions for the local file path you provided.