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

Debian9编译安装Deluge2.0.3+Libtorrent1.2.1

时隔两年,Deluge终于在最近发布了Deluge2.0,目前最新版为2.0.3,目前各大PT站还没支持这个客户端,另外Deluge很多以前的第三方插件也不能在这个新版上使用了,例如ltConfig,不过作者貌似已经在着手更新了。

除此之外,libtorrent1.2也于不久前发布,目前最新版为1.2.1,这个版本是一个完全重构的版本,和以前的1.x版本不兼容,目前Deluge2.0是完美支持1.2的,而qBittorrent也宣称会在不久的将来支持1.2。

Deluge2.0有什么改动?或者说有什么亮眼的地方?可以看看官方的这个版本发布记录:

https://deluge.readthedocs.io/en/latest/releases/2.0.html

简而言之我觉得有用的几个更新是:

1.从Python2迁移到Python3。

2.据官方所说性能有大幅度的提升,可以更快速的加载数千个种子。

这里尝尝鲜,就先用Debian编译一个玩玩,待会再水一篇在CentOS7上编译的文章。。

安装编译所需的依赖/包:

apt -y install build-essential pkg-config automake libtool python3-pip
apt -y install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev libboost-python-dev libssl-dev libgeoip-dev

编译libtorrent,编译参数注意加上Python3的路径,这样是把libtorrent的binding编译到Python3而不是默认的Python2:

wget https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_2_1/libtorrent-rasterbar-1.2.1.tar.gz
tar -xzvf libtorrent-rasterbar-1.2.1.tar.gz
cd libtorrent-rasterbar-1.2.1
./configure --enable-encryption --enable-python-binding --with-libiconv --with-libgeoip=system CXXFLAGS=-std=c++11 PYTHON=/usr/bin/python3
make -j8
make install
ldconfig

使用pip3安装Deluge所需的依赖/包:

pip3 install twisted pyopenssl simplejson pyxdg chardet geoip setproctitle pillow mako service_identity

注意之前说过Deluge2.0是支持Python3的,所以这里我们也会使用Python3来安装Deluge:

wget https://ftp.osuosl.org/pub/deluge/source/2.0/deluge-2.0.3.tar.xz
tar -xJf deluge-2.0.3.tar.xz
cd deluge-2.0.3
python3 setup.py build
python3 setup.py install

目前我遇到的一个坑是报这个错:

error: pyasn1 0.1.9 is installed but pyasn1<0.5.0,>=0.4.1 is required by {'pyasn1-modules'}

执行下面的命令修复:

pip3 install --upgrade --force-reinstall pyasn1

重新安装一次就行了:

python3 setup.py install

新建deluged的systemd服务:

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的systemd服务:

nano /etc/systemd/system/deluge-web.service

写入(注意现在Deluge的WEBUI也需要加上-d才是以daemon的方式运行):

[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 -d
Restart=on-failure
[Install]
WantedBy=multi-user.target

管理命令:

systemctl start deluged
systemctl start deluge-web
systemctl enable deluged
systemctl enable deluge-web

总体上来说的话,在Debian9上编译Deluge2.0是没什么大坑的,因为毕竟Debian9的Boost库和gcc编译器的版本都比较新,再加上自带Python3,所以编译起来还是挺容易的。

赞(2)
未经允许不得转载:荒岛 » Debian9编译安装Deluge2.0.3+Libtorrent1.2.1
分享到: 更多 (0)

评论 3

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

    libtorrent已经更新到1.2.13了,用这个方法不能更新到这个版本,搜索了下问题,试着把参数改成CXXFLAGS=-std=c++14,但是还不行,具体要怎么弄啊,求指教

    spiderman3年前 (2021-03-29) Firefox 78.0 Firefox 78.0 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿