Resolving the ‘aria2c: command not found’ Issue on Linux

Linux Resolving the ‘aria2c: command not found’ Issue

Today, while setting up a Debian 10 environment, I encountered an error: ‘aria2c: command not found’. After various searches and attempts, I was able to resolve it.

The reason is that the system does not have the aria2c command installed or it has not been added to the system’s environment variables, which leads to the error when trying to use it.

Solution

Install aria2c

To resolve this issue, you first need to install aria2c. Different operating systems have different installation methods.

Here are some installation guides for common operating systems:

Ubuntu/Debian systems:

sudo apt-get update
sudo apt-get install aria2

CentOS/Fedora systems:

sudo yum install aria2

After installation, you can try running the aria2c command to see if the issue has been resolved.

Add Environment Variable

If the ‘aria2c: command not found’ error still appears after installation, it may be because the system cannot find the aria2c command. You can try adding it to the system’s environment variables.

Here are some methods to add environment variables for common operating systems:

For Ubuntu/Debian systems:

Edit the ~/.bashrc file and add the following content:

export PATH=$PATH:/usr/bin

Then execute the following command to make the changes effective:

source ~/.bashrc

For CentOS/Fedora systems:

Edit the ~/.bash_profile file and add the following content:

export PATH=$PATH:/usr/bin

Then execute the following command to make the changes effective:

source ~/.bash_profile

The ‘aria2c: command not found’ error is usually due to the system not having the aria2c command installed or not having it added to the system’s environment variables. To resolve this issue, you first need to install aria2c and then ensure it is added to the system’s environment variables.

Leave a Comment