amtoaer

晓风残月

叹息似的渺茫,你仍要保存着那真!
github
x
telegram
steam
nintendo switch
email

Aria2 User Guide for Arch Linux

Recently, I have been quite fed up with the slow downloads in Chrome, so I tried configuring Aria2 and found it to be very good. The process is recorded below.

Backend#

Installation#

Aria2 can be found in the Arch Linux repository, and all we need to do is:

sudo pacman -S aria2

Configuration#

After installation, we would normally need to perform complex configuration, but fortunately, someone has already compiled a relatively universal configuration solution. We can make minor modifications based on the comments in this configuration.

The default configuration file for Aria2 is ~/.aria2/aria2.conf. For convenience, we can directly place the configuration file here:

cd ~
git clone https://github.com/P3TERX/aria2.conf
mv aria2.conf .aria2

Then open ~/.aria2/aria2.conf and make modifications according to the configuration (usually only need to modify various paths and rpc-secret).

Automatic Startup#

With the above configuration file, we have enabled rpc for aria2.

Here's an explanation: The default mode of Aria2 is to manually run aria2 for each download and automatically close it after completion. However, with rpc enabled, aria2 will run as a background application, and we can request downloads from the background aria2 at any time.

In general, it is recommended to use rpc, as many frontends for aria2 are based on rpc operation.

Based on the above explanation, we know that the current aria2 needs to be started in the background, and we cannot manually execute it every time we start up. Therefore, we need to configure automatic startup for it. Arch Wiki recommends using systemd:

To use aria2 as a daemon, you can write a systemd user unit.

要将 aria2 用作守护程序,您可以编写一个 systemd 用户单元。

Specifically, you need to place an aria2.service service in the ~/.config/systemd/user directory, with the following content:

[Unit]
Description=Aria2 Daemon

[Service]
ExecStart=/usr/bin/aria2c

[Install]
WantedBy=default.target

Then execute the following command to start it:

systemctl --user enable aria2.service
systemctl --user start aria2.service

Backend configuration is now complete.

Frontend#

Currently, there are several popular Aria2 frontends, such as AriaNg, webui-aria2, yaaw, etc., and their usage is similar.

My goal is to use it to replace Chrome's built-in download function, so in the end, I chose the Aria2 for Chrome extension. This extension can intercept Chrome's download requests and forward them to Aria2, and it also embeds the AriaNg frontend interface for user management. I will mainly introduce this extension.

First, install the extension and configure it:

20210207225704

Although theoretically, configuring it in the extension should be sufficient, for safety reasons, we then open the embedded AriaNg in the extension and perform the same configuration inside:

20210207225930

The other Aria2 options do not need to be changed because they use the backend configuration we did earlier.

After completing the configuration, open the sidebar. If the sidebar displays "Aria2 Status: Connected," it means the configuration was successful. Congratulations!

20210207230538

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.