因为qBittorrent/Deluge都依赖于libtorrent-rasterbar,所以编译一个libtorrent-rasterbar之后可以让qBittorrent/Deluge共存,所以这篇文章我同时把两个客户端都装上。
如果是用来刷PT,那么开启BBR很重要,Debian9默认的内核已经是4.9版本,可以直接通过下面的命令开启BBR:
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf sysctl -p
更新一下源信息:
apt update
更新系统:
apt dist-upgrade
安装编译所需的各种依赖和包:
apt -y install build-essential pkg-config automake libtool git apt -y install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libssl-dev libgeoip-dev apt -y install qtbase5-dev qttools5-dev-tools libqt5svg5-dev
如果待会你要安装Deluge,则还需要安装两个包:
apt -y install libboost-python-dev apt -y install python-setuptools
如果想节约时间不编译libtorrent-rasterbar,可以用APT安装旧版本(不推荐):
apt-get install libtorrent-rasterbar-dev
现在编译libtorrent-rasterbar最新版,注意配置参数这里开启python绑定(用于Deluge):
wget https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_1_11/libtorrent-rasterbar-1.1.11.tar.gz tar -xzvf libtorrent-rasterbar-1.1.11.tar.gz ./configure --enable-encryption --enable-python-binding --with-libiconv --with-libgeoip=system CXXFLAGS=-std=c++11 make -j4 make install
完成之后我们就可以来编译安装qBittorrent了:
wget https://github.com/qbittorrent/qBittorrent/archive/release-4.1.4.tar.gz tar -xzvf release-4.1.4.tar.gz cd qBittorrent-release-4.1.4 ./configure --prefix=/usr --disable-gui CXXFLAGS=-std=c++11 make -j4 make install
完成之后执行下面的命令先启动一次qBittorrent,按Y同意软件协议之后按键盘组合键Ctrl+C退出来。
qbittorrent-nox
新建一个qBittorrent的服务文件:
nano /etc/systemd/system/qbittorrent.service
写入:
[Unit] Description=qBittorrent Daemon Service After=network.target [Service] User=root ExecStart=/usr/bin/qbittorrent-nox ExecStop=/usr/bin/killall -w qbittorrent-nox [Install] WantedBy=multi-user.target
重载systemd配置:
systemctl daemon-reload
然后我们就可以用systemd来管理qBittorrent了:
systemctl start qbittorrent systemctl enable qbittorrent systemctl status qbittorrent systemctl stop qbittorrent
现在来编译安装Deluge,首先用python-setuptools安装pip:
easy_install pip
然后直接用pip去安装Deluge所需的依赖:
pip install twisted pyopenssl simplejson pyxdg chardet geoip setproctitle pillow mako service_identity
现在下载Deluge的源码:
cd /root wget http://download.deluge-torrent.org/source/deluge-1.3.15.tar.gz tar -xzvf deluge-1.3.15.tar.gz cd deluge-1.3.15
编译并完成安装:
python setup.py build python setup.py install
还是老样子新建一个服务文件,用于deluge的后端:
nano /etc/systemd/system/deluged.service
写入:
[Unit] Description=Deluge Bittorrent Client Daemon Documentation=man:deluged After=network-online.target [Service] Type=simple User=root Group=root UMask=007 ExecStart=/usr/local/bin/deluged -d Restart=on-failure # Time to wait before forcefully stopped. TimeoutStopSec=300 [Install] WantedBy=multi-user.target
再新建一个服务文件用于deluge的WEB服务:
nano /etc/systemd/system/deluge-web.service
写入:
[Unit] Description=Deluge Bittorrent Client Web Interface Documentation=man:deluge-web After=network-online.target deluged.service Wants=deluged.service [Service] Type=simple User=root Group=root UMask=027 # This 5 second delay is necessary on some systems # to ensure deluged has been fully started ExecStartPre=/bin/sleep 5 ExecStart=/usr/local/bin/deluge-web Restart=on-failure [Install] WantedBy=multi-user.target
重载systemd配置:
systemctl daemon-reload
使用systemd管理Deluge:
systemctl start deluged systemctl start deluge-web systemctl enable deluged systemctl enable deluge-web systemctl status deluged systemctl status deluge-web systemctl stop deluged systemctl stop deluge-web
参考文献:
https://github.com/qbittorrent/qBittorrent/wiki/Compiling-qBittorrent-on-Debian-and-Ubuntu
https://dev.deluge-torrent.org/wiki/Installing/Source
https://dev.deluge-torrent.org/wiki/Building/libtorrent
https://dev.deluge-torrent.org/wiki/UserGuide/Service/systemd
哎哟,好像忘记配张图了。。。补一下。。。
什么鬼?跑墙外去了?
才发现嘛?
大佬以后要改用debian9了吗
只是把两台用来刷PT的服务器改用Debian9了,主要是开BBR方便。。。
并不一样
./configure –disable-debug –enable-encryption –with-libgeoip=system CXXFLAGS=-std=c++11
qbittorrent
./configure –enable-python-binding –with-libiconv
deluge
这个是把libtorrent编译成一个模块
最好还是用checkinstall构建成deb
然后再用dpkg -i
才是最骚的
大佬这个版本的libtorrent-rasterbar会有Deluge的守护进挂掉的问题吗
用了一段时间没碰到过。
多谢大佬,这问题找了半天才找到你博客
博主你好
请问如何给qBittorrent配置qBittorrent-Enhanced-Edition的ipfilter.dat呢?
~/.config/qBittorrent/ to block Offline Downloader这段我看不懂~/.config/qBittorrent是指操作什么
不好意思,这个我没配置过。
编译qBittorrent这一步时,执行./configure –prefix=/usr –disable-gui CXXFLAGS=-std=c++11时,提示checking for libtorrent… yes
checking for zlib… no
configure: error: Package requirements (zlib >= 1.2.5.2) were not met:
No package ‘zlib’ found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables zlib_CFLAGS
and zlib_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
这个是少了文件吗
少装了一个依赖:zlib1g-dev