1.安裝libtorrent
先安装依赖:
apt-get update
apt-get install build-essential pkg-config automake libtool git libgeoip-dev python3 python3-dev -y
apt-get install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev -y
apt-get install qtbase5-dev qttools5-dev-tools libqt5svg5-dev zlib1g-dev -y
libtorrent 1.1.13: 适用于qBittorrent4.0.0或更新版本
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_1_13/libtorrent-rasterbar-1.1.13.tar.gz
tar xf libtorrent-rasterbar-1.1.13.tar.gz
cd libtorrent-rasterbar-1.1.13
./configure --disable-debug --enable-encryption --with-libgeoip=system
make -j$(nproc)
make install
ldconfig
2.安裝qBittorrent 4.1.9
wget https://github.com/qbittorrent/qBittorrent/archive/release-4.1.9.tar.gz
tar xf release-4.1.9.tar.gz
cd qBittorrent-release-4.1.9
./configure --disable-gui --disable-debug
make -j$(nproc)
make install
3.开机启动
nano /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent Daemon Service
After=network.target
[Service]
LimitNOFILE=512000
User=root
ExecStart=/usr/local/bin/qbittorrent-nox --webui-port=XXX
ExecStop=/usr/bin/killall -w qbittorrent-nox
[Install]
WantedBy=multi-user.target
启用设置:
systemctl enable qbittorrent.service
启动qBittorrent
qbittorrent-nox --webui-port=XXX
再次运行,这次在后台运行,这样shell关掉了qBittorrent不会结束进程
systemctl start qbittorrent.service