Cyberithub

[Solved] "aria2c: command not found" error

Advertisements

In this article, we will see how to solve "aria2c: command not found" error. You might have noticed that whenever you try to download a file using aria2 utility, you always encounter "aria2c: command not found" error on the output. Well, this could happen because aria2 package might not be installed in your system. So to solve the error you just have to install the package. But before that, let's understand more about aria2 utility. aria2 is a free and open source lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.

 

Features

Some of the utility features includes:-

  • Multi-Connection Download - aria2 can download a file from multiple sources/protocols utilizing your maximum available download bandwidth. This further speed up the download and hence improve overall experience.
  • Lightweight - aria2 doesn’t require much memory and CPU time. When disk cache is off, the physical memory usage is typically 4MiB (normal HTTP/FTP downloads) to 9MiB (BitTorrent downloads). CPU usage in BitTorrent with download speed of 2.8MiB/sec is around 6%.
  • Fully Featured BitTorrent Client - The features that you generally see in BitTorrent such as  DHT, PEX, Encryption, Magnet URI, Web-Seeding, Selective Downloads, Local Peer Discovery and UDP tracker are all available.
  • Metalink Enabled -  It provides the support of Metalink Download Description Format (aka Metalink v4), Metalink version 3 and Metalink/HTTP. Metalink is basically responsible for verification, HTTP/FTP/SFTP/BitTorrent integration and the various configurations for language, location, OS, etc.
  • Remote Control -  It supports RPC interface to control the aria2 process. The supported interfaces are JSON-RPC (over HTTP and WebSocket) and XML-RPC.

 

[Solved] "aria2c: command not found" error

[Solved] "aria2c: command not found" error

Also Read: How to Install and Configure Filebeat on Ubuntu/Debian

If you are using Ubuntu/Debian based systems then you can install aria2 by running sudo apt install aria2 command as shown below. This will download and install the package along with all its dependencies from default Ubuntu repo.

cyberithub@ubuntu:~$ sudo apt install aria2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaria2-0 libssh2-1
The following NEW packages will be installed:
aria2 libaria2-0 libssh2-1
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 1,514 kB of archives.
After this operation, 6,136 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libssh2-1 amd64 1.8.0-2.1ubuntu0.1 [75.5 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 libaria2-0 amd64 1.35.0-1build1 [1,082 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal/universe amd64 aria2 amd64 1.35.0-1build1 [356 kB]
Fetched 1,514 kB in 3s (601 kB/s)
Selecting previously unselected package libssh2-1:amd64.
(Reading database ... 259120 files and directories currently installed.)
Preparing to unpack .../libssh2-1_1.8.0-2.1ubuntu0.1_amd64.deb ...
Unpacking libssh2-1:amd64 (1.8.0-2.1ubuntu0.1) ...
Selecting previously unselected package libaria2-0:amd64.
Preparing to unpack .../libaria2-0_1.35.0-1build1_amd64.deb ...
Unpacking libaria2-0:amd64 (1.35.0-1build1) ...
Selecting previously unselected package aria2.
Preparing to unpack .../aria2_1.35.0-1build1_amd64.deb ...
Unpacking aria2 (1.35.0-1build1) ...
Setting up libssh2-1:amd64 (1.8.0-2.1ubuntu0.1) ...
Setting up libaria2-0:amd64 (1.35.0-1build1) ...
Setting up aria2 (1.35.0-1build1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...

Similarly, if you are looking to install aria2c on RHEL/CentOS based systems then run either sudo yum install aria2 or sudo dnf install aria2 command as shown below.

sudo yum install aria2
sudo dnf install aria2

For Arch Linux, use pacman -S aria2 command to install aria2c as shown below.

pacman -S aria2

For macOS, use brew install aria2 command to install as you can see below.

brew install aria2

After successful installation, you can check the installed version by using aria2c --version command as shown below.

cyberithub@ubuntu:~$ aria2c --version
aria2 version 1.35.0
Copyright (C) 2006, 2019 Tatsuhiro Tsujikawa

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

** Configuration **
Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC, SFTP
Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5, adler32
Libraries: zlib/1.2.11 libxml2/2.9.10 sqlite3/3.31.1 GnuTLS/3.6.11 nettle GMP/6.2.0 c-ares/1.15.0 libssh2/1.8.0
Compiler: gcc 9.3.0
built by x86_64-pc-linux-gnu
on Mar 22 2020 15:33:25
System: Linux 5.15.0-83-generic #92~20.04.1-Ubuntu SMP Mon Aug 21 14:00:49 UTC 2023 x86_64

Report bugs to https://github.com/aria2/aria2/issues
Visit https://aria2.github.io/

Sometimes it is also possible that aria2 is already installed in your system but on a different path due to which system is not able to detect the utility and hence throwing "aria2c: command not found" error. In that case, you have to set the path in PATH environment variable using below export command.

export PATH=$PATH:/aria2/installation/path

To make above changes permanent, you have to add above entry at the end of ~/.bashrc or ~/.profile file and then logout and login to your system to refresh the changes. It should work as expected. Hope above given solution would be enough to solve your "aria2c: command not found" error as well. Please let me know your feedback in the comment box.

Leave a Comment