ame

Compiling qBittorrent nox on Debian and Ubuntu
Required dependencies apt update apt install build-essent...
扫描右侧二维码阅读全文
10
2019/11

Compiling qBittorrent nox on Debian and Ubuntu

Required dependencies

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

Install Libtorrent

Libtorrent is a library written by Arvid Norberg that qBittorrent depends on.
It is necessary to compile and install libtorrent before compiling qBittorrent.

Install Libtorrent dev pkg from repository

 sudo apt-get install libtorrent-rasterbar-dev

Git repo and compile Libtorrent yourself

其他版本可以到 https://github.com/arvidn/libtorrent 获取
推荐libtorrent 1.1.12版本

wget https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_1_12/libtorrent-rasterbar-1.1.12.tar.gz
tar xf libtorrent-rasterbar-1.1.12.tar.gz
cd libtorrent-rasterbar-1.1.12
./configure --disable-debug --prefix=/usr CXXFLAGS=-std=c++11
make -j$(nproc)
make install
ln -s /usr/lib/pkgconfig/libtorrent-rasterbar.pc /usr/lib64/pkgconfig/libtorrent-rasterbar.pc
ln -s /usr/lib/libtorrent-rasterbar.so.9 /usr/lib64/libtorrent-rasterbar.so.9

Compiling qBittorrent (without the GUI)

cd 
git clone https://github.com/qbittorrent/qBittorrent.git (or git pull if already cloned)
cd qBittorrent
./configure --prefix=/usr --disable-gui CPPFLAGS=-I/usr/include/qt5
make -j$(nproc)
make install

运行qbittorrent-nox,试一下是否正常工作

浏览器打开http://yourip:8080
默认用户名:admin
默认密码:adminadmin

Set up qbittorrent as a deamon

nano /usr/lib/systemd/system/qbittorrent.service

写入

[Unit]
Description==qBittorrent torrent server
After=network.target

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

[Install]
WantedBy=multi-user.target

启用这个Unti

systemctl enable qbittorrent
systemctl start qbittorrent

Firewall (optional)

打不開WebUI的需設定Firewall:

firewall-cmd --permanent --add-port=8080/tcp

打開qBittorrent的8999監聽端口:

firewall-cmd --permanent --add-port=8999/tcp

載入設定:

firewall-cmd --reload

創建下載文件夾和設置權限

mkdir /home/Downloads
chmod 777 /home/Downloads

参考文章

https://github.com/qbittorrent/qBittorrent/wiki/Compiling-qBittorrent-on-Debian-and-Ubuntu
https://npchk.info/ubuntu-debian-install-qbittorrent/

Last modification:November 16th, 2019 at 03:10 pm

Leave a Comment