How to Auto Remove Completed Downloads in Aria2 Ubuntu
This guide explains how to configure aria2 on Ubuntu to automatically remove completed downloads from the active list. By adjusting specific configuration flags, you can ensure your download manager stays organized without manual intervention. We will cover the necessary command-line options and configuration file settings to achieve this behavior efficiently.
To prevent completed downloads from cluttering your session list, you
need to modify the max-download-result setting. By default,
aria2 keeps a record of finished tasks in memory. Setting this value to
zero instructs aria2 to discard the result immediately upon
completion.
Edit the Configuration File
The most persistent method is to update the aria2 configuration file.
Open your terminal and edit the file located at
~/.aria2/aria2.conf. If the file does not exist, you can
create it.
Add the following line to the file:
max-download-result=0
Save the changes and exit the editor. If aria2 is currently running as a daemon or service, restart it to apply the new settings. You can restart the service using the following command:
sudo systemctl restart aria2If you are running aria2 manually, stop the current process and start it again with the configuration file loaded.
Use Command-Line Arguments
If you prefer not to edit the configuration file, you can pass the argument directly when starting aria2. This is useful for temporary sessions or scripts. Append the flag to your usual startup command:
aria2c --max-download-result=0 --enable-rpcThis ensures that for this specific session, no completed download results are retained in the list.
Verify the Configuration
To confirm the setting is active, you can check the aria2 logs or observe the behavior during a test download. Once a download finishes, it should not appear in the list of stopped or completed tasks when queried via RPC or the terminal interface. This keeps your download environment clean and focused on active tasks.