How to Download Files from the Internet Using Aria2 on Ubuntu Terminal
This is an article about downloading files efficiently and reliably from the internet using a command-line utility called aria2. In this article, you will learn how to install and use aria2 in your Ubuntu terminal for managing downloads with advanced features like resumable downloads and multi-file connections.
Aria2 is a lightweight cross-platform download utility. It supports HTTP/HTTPS, FTP and BitTorrent protocols and can handle multiple simultaneous connections to the same file or split files into several sections to be downloaded concurrently, which greatly improves the speed of downloading large files.
What Is Aria2?
Before diving deep into how to use aria2 for downloading files, it’s important to understand what exactly aria2 is. Aria2 is a lightweight, multi-protocol command-line download utility that can manage downloads from various sources such as HTTP/HTTPS, FTP and native BitTorrent support. It allows users to control their file transfers via the command line or XML-RPC interface with advanced features like resuming partial downloads, specifying custom download directories, and managing multiple simultaneous connections.
Why Use Aria2?
Using aria2 can significantly enhance your downloading experience for several reasons:
- Speed: By splitting files into pieces and using multiple connections to download them simultaneously, aria2 can achieve faster speeds.
- Reliability: The ability to resume downloads from where they were interrupted makes it reliable when dealing with unstable network conditions or large file sizes.
- Versatility: It supports a wide range of protocols and is highly configurable through its command-line options.
Installation
Installing aria2 on Ubuntu is straightforward. Follow these steps:
- Open the terminal (Ctrl + Alt + T).
- Update your package list to ensure you have access to the latest versions:sudo apt update
- Install aria2 using apt:sudo apt install aria2
Once installed, you can start exploring its features.
Basic Usage
After installation, accessing and utilizing aria2’s core functionalities is easy:
-
Download a Single File: To download a single file from the internet, use the following command format:
aria2c <URL>For example:
aria2c https://example.com/file.zip -
Specify Output Directory and Filename: If you want to specify where the download should be saved or give it a custom name, use:
aria2c -d <directory> --out=<filename> <URL>Example:
aria2c -d ~/Downloads --out=example.zip https://example.com/file.zip -
Resume Downloads: If a download was interrupted, you can resume it by appending the -c (or --continue) option to your command:
aria2c -c <URL>
Advanced Features
Aria2 offers several powerful features that make it more than just a basic downloader. Here are some of them:
Multi-File Downloads
aria2 can handle multiple files at once, which is especially useful when downloading collections or directories from websites.
To download multiple files simultaneously, you can provide aria2 with URLs separated by spaces:
BitTorrent Support
Aria2 supports native BitTorrent protocol. To download a .torrent file, use the following command format:
For instance:
Setting Connection Parameters
You can control how aria2 interacts with servers by specifying connection parameters. Here are a few examples:
-
Limiting Download Speed: Use the --max-download-limit option to set a maximum speed limit in bytes per second.
aria2c --max-download-limit=10k <URL> -
Setting Number of Connections: Specify the number of connections using --split=<n>.
aria2c --split=5 http://example.com/largefile.zip
Logging and Notifications
Aria2 provides logging capabilities to monitor download progress. You can redirect output to a log file or use external scripts for notifications.
To save the log of your downloads:
This feature is invaluable for debugging issues and tracking long-term downloads.
Conclusion
Read this article to find out about how to install and efficiently manage file downloads on Ubuntu using aria2. Aria2’s powerful features make it an indispensable tool for anyone dealing with large or complex download tasks, offering speed, reliability, and configurability that go beyond basic download utilities.
Last Modified: 25/05/2019 - 19:32:28