静看光阴荏苒
不管不顾不问不说也不念

Debian9编译安装qBittorrent/Deluge/libtorrent-rasterbar

因为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

哎哟,好像忘记配张图了。。。补一下。。。

赞(2)
未经允许不得转载:荒岛 » Debian9编译安装qBittorrent/Deluge/libtorrent-rasterbar
分享到: 更多 (0)

评论 13

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    什么鬼?跑墙外去了? :grin:

    vshare6年前 (2018-12-16) Google Chrome 71.0.3578.83 Google Chrome 71.0.3578.83 Android 8.0.0 Android 8.0.0回复
    • 才发现嘛?

      LALA6年前 (2018-12-17) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    大佬以后要改用debian9了吗

    david6年前 (2018-12-20) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 只是把两台用来刷PT的服务器改用Debian9了,主要是开BBR方便。。。

      LALA6年前 (2018-12-21) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    并不一样
    ./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
    才是最骚的

    z6年前 (2018-12-22) Firefox 64.0 Firefox 64.0 Android 8.1.0 Android 8.1.0回复
  4. #4

    大佬这个版本的libtorrent-rasterbar会有Deluge的守护进挂掉的问题吗

    jjchizha6年前 (2019-01-11) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 用了一段时间没碰到过。

      LALA6年前 (2019-01-11) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 多谢大佬,这问题找了半天才找到你博客

        jjchizha6年前 (2019-01-11) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    博主你好
    请问如何给qBittorrent配置qBittorrent-Enhanced-Edition的ipfilter.dat呢?
    ~/.config/qBittorrent/ to block Offline Downloader这段我看不懂~/.config/qBittorrent是指操作什么 :cry:

    菜鸟5年前 (2019-05-13) Google Chrome 74.0.3729.131 Google Chrome 74.0.3729.131 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 不好意思,这个我没配置过。

      LALA5年前 (2019-05-14) Google Chrome 72.0.3626.121 Google Chrome 72.0.3626.121 Windows 10 x64 Edition Windows 10 x64 Edition回复
  6. #6

    编译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.
    这个是少了文件吗

    david5年前 (2019-11-16) Google Chrome 78.0.3904.97 Google Chrome 78.0.3904.97 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 少装了一个依赖:zlib1g-dev

      LALA5年前 (2019-11-17) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿