如何安装下载工具aria2

ARIA2是Linux系统的命令行工具,可以使用各种协议下载文件,包括HTTP/HTTPS,FTP,SFTP,BitTorrent和Metalink。

ARIA2命令行使用示例

  • 就像WGET一样,我们无需使用ARIA2C命令指定任何另外选项以启动下载。只需指定要抓取的文件的链接,它将被下载到我们当前的工作目录。
$aria2c https://example.com/linux-distro.iso

我们可以随时停止使用“Ctrl + C”键盘组合的下载。如果我们停止下载或者其他中断,则可以通过再次使用相同的下载命令来恢复它。

  • 从FTP源下载遵循与上述相同的语法。
$aria2c ftp://example.com/linux-distro.iso
  • 要潜行加速下载,我们可以使用同一文件的多个来源(AKA下载镜像)提供给ARIA2:
$aria2c https://example.com/linux-distro.iso https://example.org/linux-distro.iso
  • 我们可以通过首先将.torrent文件下载到系统,或者直接将链接传递给aria2.
$aria2c linux-distro.torrent
OR
$aria2c https://example.com/linux-distro.torrent

在第二种情况下,ARIA2将首先将.Torrent文件下载到下载目录,然后开始下载数据。如果我们不希望ARIA2下载Torrent文件,只需使用- follow-torrent = mem选项。

$aria2c --follow-torrent=mem https://example.com/linux-distro.torrent
  • Metalink是一个文件,其中包含要下载数据的所有可能源。这意味着,而是使用多个来源提供ARIA2,我们只能提供单个Metalink URL或者Metalink文件。使用通常的语法启动下载,但ARIA2将自动使用多个来源来拉动文件。
$aria2c https://example.com/linux-distro.metalink
  • 正如我们可能已经猜到的那样,通过Torrent Magnets下载的语法与前一个示例中的相同。只需要提供磁链接:
$aria2c magnet:?xt=urn:btih:1e99d95f1764644a86a8e99bfd80c ...

aria2配置文件 ~/.aria2/aria2.conf:

enable-xml-rpc
follow-torrent=mem
seed-ratio=2

安装ARIA2

在Ubuntu,Debian和Linux Mint上安装Aria2:

$sudo apt install aria2

在CentOS,Fedora,Almalinux和Red Hat中安装Aria2:

$sudo dnf install aria2

在Arch Linux和Manjaro上安装Aria2:

$sudo pacman -S aria2
日期:2020-07-07 20:54:58 来源:oir作者:oir