Commands.page Logo

How to Remove Aria2 Download by GID on Ubuntu

This guide details the process of removing specific downloads from the queue on Ubuntu using the Aria2 download manager. It explains how to identify the Global ID (GID) of a transfer and executes the precise command required to cancel it via the command line interface.

This functionality applies specifically to aria2c, as standard package managers like apt do not use GIDs for download queues. To manage downloads by GID, you must have Aria2 running with RPC (Remote Procedure Call) enabled. Start the daemon using the following command to enable the necessary interface:

aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all=true

Once Aria2 is running, you need a client to send the removal command. The most efficient command-line tool for this is aria2p. You can install it via pip:

pip3 install aria2p

To remove a download, you first need to find its GID. List the active downloads to locate the specific ID:

aria2p list

Copy the GID associated with the download you wish to cancel. To remove the specific download from the queue, use the remove command followed by the GID:

aria2p remove <GID>

Replace <GID> with the actual alphanumeric string identified in the previous step. This command immediately stops the transfer and removes it from the active queue. If you prefer not to install aria2p, you can send a direct JSON-RPC request using curl, though the aria2p method is more straightforward for routine management.