Get Permissions
sudo -i
Install dependency
apt-get install -y wget libcurl4-openssl-dev libevent-dev ca-certificates libssl-dev pkg-config build-essential intltool libxml2-dev libgcrypt-dev libssl-dev
Compile and download the latest source code of aira2
# GitHub address: https://github.com/aria2/aria2/releases/
wget https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0.tar.gz
Decompress the source code, compile and install
tar -zxvf aria2-1.34.0.tar.gzcd aria2-1.34.0./configuremake
After compilation, enter the/root/aria2-1.34.0/src directory and copy the aria2c file to the bin directory.
cp /root/aria2-1.34.0/src/aria2c /usr/local/bin
Create the aira2 directory
sudo mkdir -p /etc/aria2
Compile the aira2 configuration file
vim /etc/aria2/aria2.conf
Content:
# File storage ### file storage directory, where the Mount address dir =/mnt/storage/download # enables disk caching and 0 indicates disabling caching, for Versions later than 1.16, the default value is 16mdisk-cache = 32 m # resumable data transfer (CONTINUE) = true # file pre-distribution method, which can effectively reduce disk fragments. Default Value: prealloc # pre-allocation time: none <falloc? Trunc <prealloc # falloc and trunc require file system and Kernel support # falloc is recommended for NTFs, and trunc is recommended for ext3/4, note this item in MAC # file-allocation = falloc # download connection ### maximum number of simultaneous download tasks, which can be modified during running. Default Value: 5 # Max-Concurrent-downloads = 5 # Number of connections to the same server, which can be specified when added. Default Value: 1max-connection-per-server = 16 # overall download speed limit, which can be modified during running. Default Value: 0 (unlimited) # Max-overall-download-Limit = 0 # download speed limit for a single task. Default Value: 0 (unlimited) # Max-download-Limit = 0 # overall upload speed limit, which can be modified during runtime. Default Value: 0 (unlimited) # Max-overall-upload-Limit = 0 # upload speed limit for a single task. Default Value: 0 (unlimited) # Max-upload-Limit = 0 # disable IPv6. Default Value: falsedisable-ipv6 = true # Minimum File part size, can be specified when added, value range 1 m-1024 M, default: 20 m # assuming size = 10 m, if the file is 20 MiB, two sources are used for download. If the file is 15 MiB, one source is used for download. Min-Split-size = 10 m # maximum number of threads for a single task. This parameter can be specified when adding a file. The default value is: 5 split = 10 # progress saving ### read the download task input-file =/etc/aria2/aria2.session # Save the wrong and incomplete tasks when aria2 exits download the task to the session File Save-session =/etc/aria2/aria2.session # Save the session regularly, 0 is saved only when you exit. Version 1.16.1 or later is required. Default Value: 0save-session-interval = 60 # RPC-related settings ### Enable RPC. Default Value: falseenable-RPC = true # Allow all sources, default Value: falserpc-allow-origin-All = true # allow external access. Default Value: falserpc-Listen-All = true # rpc port, modify # RPC-Listen-Port = 6800 # The configured RPC authorization token only when the default port is occupied. This function is available in v1.18.4, replace the -- RPC-user and -- RPC-passwd options # RPC-secret =## BT/Pt download ### when downloading is a seed (. at the end of torrent), the BT task is automatically started. The default value is true # Follow-Torrent = true # client disguise, PT requires peer-ID-Prefix =-TR2770-user-agent = Transmission/2.77 # force save session, even if the task has been completed, default: false # The new version will be retained after the task is completed. aria2 file # force-save = false # When you continue the previous BT task, you do not need to verify it again. Default Value: falsebt-seed-unverified = true # Save the magnetic link metadata as the seed file (. torrent file). Default Value: falsebt-save-Metadata = true # Bt-trackbt-tracker = UDP: // tracker.skyts.net: 6969/announce, UDP: // tracker. safe. MOE: 6969/announce, UDP: // tracker.piratepublic.com: 1337/announce, UDP: // tracker. pirateparty. GR: 6969/announce, UDP: // tracker. coppersurfer. TK: 6969/announce, UDP: // tracker.leechers-paradise.org: 6969/announce, UDP: // allesanddro.de: 1337/announce, UDP: // 9.rarbg.com: 2710/announce, http://p4p.arenabg.com: 1337/announce, UDP: // p4p.arenabg.com: 1337/announce, UDP: // tracker.opentrackr.org: 1337/announce, http://tracker.opentrackr.org: 1337/announce, UDP: // public.popcorn-tracker.org: 6969/announce, UDP: // tracker2.christianbro. PW: 6969/announce, UDP: // tracker1.xku. TV: 6969/announce, UDP: // tracker1.wasabii.com.tw: 6969/announce, UDP: // tracker. zer0day. to: 1337/announce, UDP: // tracker.mg64.net: 6969/announce, UDP: // peerfect.org: 6969/announce, UDP: // open.facedatabg.net: 6969/announce
Create aria2.session
touch /etc/aria2/aria2.session
Edit Startup File
vim /etc/init.d/aria2c
Content:
#! /Bin/sh ### begin init info # provides: aria2 # required-start: $ remote_fs $ Network # required-stop: $ remote_fs $ Network # default-start: 2 3 4 5 # default-stop: 0 1 6 # Short-Description: aria2 downloader ### end init infouser = root
Retval = 0
Case "$1" instart) echo-n "Starting aria2c \ n" aria2c -- conf-Path =/etc/aria2/aria2.conf-D # Sudo-u is followed by the user name you are using, because I use PI; stop) echo-n "shutting down aria2c" killall aria2c; restart) echo-n "shutting down aria2c" killall aria2csleep 3 echo-n "Starting aria2c" aria2c -- conf-Path =/etc/aria2/aria2.conf-D # Same as above, change PI according to your username .;; *) Echo 'usage: ''basename $ 0' '[Option] 'echo 'available option:' for option in start stop restart do echo '-' $ option done; esac
Exit $ retval
Set File Permissions
chmod 755 /etc/init.d/aria2c
Set startup and Automatic startup
service aria2c startupdate-rc.d aria2c defaults
Raspberry Pi compiles the latest aria2