Commands.page Logo

Configure aria2 to Ignore Proxy Environment Variables Ubuntu

This guide explains how to configure the aria2 download utility on Ubuntu to bypass system-wide proxy settings. When environment variables like http_proxy are set, aria2 may attempt to route traffic through them unnecessarily. You will learn how to disable this behavior using command-line flags or configuration files to ensure direct connections.

Use Command-Line Flags

The quickest method to ignore proxy settings is by passing an empty proxy value directly when running aria2c. Use the --all-proxy option followed by an empty string. This overrides any environment variables detected by the system.

aria2c --all-proxy= "http://example.com/file.zip"

You can also specify empty values for HTTP and HTTPS specifically if needed:

aria2c --http-proxy= --https-proxy= "http://example.com/file.zip"

Modify the Configuration File

For a permanent solution, edit the aria2 configuration file. This ensures every download session ignores proxy settings without requiring extra command-line arguments. Open or create the configuration file located at ~/.aria2/aria2.conf.

Add the following lines to the file:

all-proxy=
http-proxy=
https-proxy=

Save the file and exit. Any subsequent aria2 commands will now read this configuration and bypass the proxy environment variables automatically.

Unset Environment Variables Temporarily

If you prefer not to change aria2 settings, you can unset the proxy variables in your current shell session before running the command. This prevents aria2 from detecting them in the first place.

Run the following commands in your terminal:

unset http_proxy
unset https_proxy
unset ALL_PROXY
aria2c "http://example.com/file.zip"

This method only applies to the current terminal session and does not alter system settings or aria2 configuration files.