编译构建qBittorrent

安装依赖包

1
2
3
4
apt update
apt install -y build-essential pkg-config automake libtool git libgeoip-dev python3 python3-dev
apt install -y libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev
apt install -y qtbase5-dev qttools5-dev-tools libqt5svg5-dev zlib1g-dev

编译安装libtorrent

1
2
3
4
5
6
7
wget https://github.com/arvidn/libtorrent/releases/download/v1.2.12/libtorrent-rasterbar-1.2.12.tar.gz
tar xf libtorrent-rasterbar-1.2.12.tar.gz
cd libtorrent-rasterbar-1.2.12
./configure --disable-debug --enable-encryption --with-libgeoip=system CXXFLAGS=-std=c++14
make -j$(nproc)
make install
ldconfig

编译安装qBittorrent

1
2
3
4
5
6
wget https://github.com/qbittorrent/qBittorrent/archive/release-4.3.3.tar.gz
tar xf release-4.3.3.tar.gz
cd qBittorrent-release-4.3.3
./configure --disable-gui --disable-debug
make -j$(nproc)
make install

编写守护进程

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
vim /etc/systemd/system/qbittorrent.service

[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
LimitNOFILE=512000
User=root
ExecStart=/usr/local/bin/qbittorrent-nox
ExecStop=/usr/bin/killall -w qbittorrent-nox

[Install]
WantedBy=multi-user.target

启动、配置自启

1
2
3
4
systemctl daemon-reload
systemctl enable qbittorrent.service
qbittorrent-nox
systemctl start qbittorrent.service