Commands.page Logo

Verify SHA-512 Hash During Aria2 Download Ubuntu

This guide explains how to use the aria2 command-line utility on Ubuntu to download files while simultaneously verifying their integrity. You will learn the specific flag required to check a SHA-512 hash during the transfer process, ensuring your data remains secure and uncorrupted without needing separate verification steps.

To download a file and verify its SHA-512 hash in one step, use the aria2c command with the --checksum option. The syntax requires specifying the algorithm type followed by the hash value.

Here is the basic command structure:

aria2c --checksum=sha-512=HASH_VALUE URL

Replace HASH_VALUE with the actual 128-character hexadecimal string provided by the source and URL with the direct download link. When you execute this command in the Ubuntu terminal, aria2 downloads the file and immediately calculates its hash. If the calculated hash matches the provided value, the download completes successfully. If the hashes do not match, aria2 stops the download and reports a checksum error, preventing corrupted files from saving to your system.

This method streamlines the workflow by combining retrieval and validation into a single operation. Ensure you copy the hash exactly as provided, including all characters, to avoid validation failures.