In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use Aria2 to improve download speed under Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Aria2 is a multi-platform lightweight command line download tool that supports HTTP, FTP, BitTorrent and other multi-protocols and multi-sources. Aria2 can download resources from multiple sources and protocols, making the most of your bandwidth.
Install aria2 under 1.Linux
We can easily install aria2 command line downloaders on all Linux distributions, such as Debian, Ubuntu, Mint, RHEL, CentOS, Fedora, suse, openSUSE, Arch Linux, Manjaro, Mageia, etc. Just type the following command to install it. For CentOS and RHEL systems, we need to enable support for uget or RPMForge libraries.
[for Debian, Ubuntu and Mint] $sudo apt-get install aria2 [for CentOS, RHEL, Fedora 21 and earlier operating systems] # yum install aria2 [Fedora 22 and later] # dnf install aria2 [for suse and openSUSE] # zypper install wget [Mageia] # urpmi aria2 [for Debian, Ubuntu and Mint] $sudo pacman-S aria22. Download a single file
The following command will download a file from the specified URL and save it in the current directory. During the download process, we can see the file's (date, time, download speed and download progress).
# aria2c https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#986c80 19MiB/21MiB] 03opt/owncloud-9.0.0.tar.bz2Status Legend 22 09:49:13 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===986c80 | OK | 3.0MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.3. Save the file with a different name
When initializing the download, we can use the-o (lowercase) option to use a different name when saving the file. Here we are going to use the owncloud.zip file name to save the file.
# aria2c-o owncloud.zip https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#d31304 16MiB/21MiB (74%) CN:1 DL:6.2MiB] 03ax 22 09:51:02 [NOTICE] Download complete: / opt/owncloud.zipDownload Results:gid | stat | avg speed | path/URI=+====+=+===d31304 | OK | 7.3MiB/s | / opt/owncloud.zipStatus Legend: (OK): download completed.4. Download speed limit
By default, aria2 uses the full bandwidth to download files, and there is nothing we can do on the server until the file download is complete (which will affect the access bandwidth of other services). So it's best to use it when downloading large files
-max-download-limit
Option to avoid further problems.
# aria2c-- max-download-limit=500k https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#7f9fbf 21MiB/21MiB [99% CN:1 DL:466KiB] 03ax 22 09:54:51 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===7f9fbf | OK | 462KiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.5. Download multiple files
The following command will download more than one file from the specified location and save it to the current directory. In the process of downloading the file, we can see the file's (date, time, download speed and download progress).
# aria2c-Z https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2 ftp://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz[DL:1.7MiB][#53533c 272KiB/21MiB] [# b52bb1 768KiB/3.6MiB] 03Universe 22 10:25:54 [NOTICE] Download complete: / opt/wget-1.17.tar.gz [# 53533c 18MiB/21MiB (86%) CN: 1 DL:3.2MiB] 03 DL:3.2MiB 22 10:25:59 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===b52bb1 | OK | 2.8MiB/s | / opt/wget-1.17.tar.gz53533c | OK | 3.4MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.6. Resume the unfinished download
When you encounter some network connection problems or system problems, and you are about to download a large file (for example, ISO image file), I suggest you use the-c option, which can help us to continue the incomplete download from that state and finish it as usual. Otherwise, when you download again, it will initialize the new download and save it to a different file name (automatically add. 1 after the file name). Note: if there is any interruption, aria2 saves the (unfinished) file with the .aria2 suffix.
# aria2c-c https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#db0b08 8.2MiB/21MiB (38%) CN:1 DL:3.1MiB ETA:4s] ^ C03 go 22 10:09:26 [NOTICE] Shutdown sequence commencing... Press Ctrl-C again for emergency shutdown.03/22 10:09:26 [NOTICE] Download GID#db0b08bf55d5908d not complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===db0b08 | INPR | 3.3MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (INPR): download in-progress. If you restart the transfer, aria2 will resume the download. # aria2c-c https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#873d08 21MiB/21MiB (98%) CN:1 DL:2.7MiB] 03Gamma 22 10:09:57 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===873d08 | OK | 1.9MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.7. Get input from a file
Just as wget can get a list of input URL from a file to download. We need to create a file to store each URL on a separate line. The ara2 command line can add the-I option to do this.
# aria2c-I test-aria2.txt [DL:3.9MiB] [# b97984 192KiB/21MiB] [# 673c8e 2.5MiB/3.6MiB (69%)] 03opt/wget-1.17.tar.gz 22 10:14:22 [NOTICE] Download complete: / opt/wget-1.17.tar.gz [# b97984 19MiB/21MiB (90%) CN:1 DL:2.5MiB] 03gam22 10:14:30 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===673c8e | OK | 4.3MiB/s | / opt/wget-1.17.tar.gzb97984 | OK | 2.5MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.8. Each host uses two connections to download
By default, the maximum number of connections to one server per download can only be established for one host. We can add-x2 (2 for two connections) from the aria2 command line to create multiple connections to each host to speed up the download.
# aria2c-x2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2[#ddd4cd 18MiB/21MiB (83%) CN:1 DL:5.0MiB] 03ax 22 10:16:27 [NOTICE] Download complete: / opt/owncloud-9.0.0.tar.bz2Download Results:gid | stat | avg speed | path/URI=+====+=+===ddd4cd | OK | 5.5MiB/s | / opt/owncloud-9.0.0.tar.bz2Status Legend: (OK): download completed.9. Download the BitTorrent seed file
We can download a BitTorrent seed file directly using the aria2 command line:
# aria2c https://torcache.net/torrent/C86F4E743253E0EBF3090CCFFCC9B56FA38451A3.torrent?title=[kat.cr]irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr[#388321 0B/0B CN:1 DL:0B] 03/22 20:06 : 14 [NOTICE] Download complete: / opt/ [kat.cr] irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr.torrent03/22 20:06:14 [ERROR] Exception caughtException: [BtPostDownloadHandler.cc:98] errorCode=25 Could not parse BitTorrent metainfoDownload Results:gid | stat | avg speed | path/URI=+====+=+===388321 | OK | 11MiB/s | / opt/ [kat.cr] irudhi.suttru.2015.official.teaser.full.hd.1080p.pathi.team.sr.torrentStatus Legend: (OK): download completed.10. Download BitTorrent Magnetic Link
Using aria2, we can also download a seed file directly through the BitTorrent magnetic link:
# aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'11. Download BitTorrent Metalink seed
We can also download a Metalink file directly from the aria2 command line.
# aria2c https://curl.haxx.se/metalink.cgi?curl=tar.bz212. Download a file from a password-protected website
Or, we can download a file from a password-protected website. The following command line will download the file from a password-protected website.
# aria2c-http-user=xxx-http-password=xxx https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2# aria2c-ftp-user=xxx-ftp-password=xxx ftp://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz13. Read more about aria2
If you want to know more about the options-they also apply to wget, enter the following command line to get more information on your own terminal:
# man aria2cor# aria2c-help
This is the end of this article on "how to use Aria2 to improve download speed under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 270
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.