Linux编译安装qBittorrent

发布于 2021-07-12  848 次阅读


qBittorrent是一个跨平台自由BitTorrent客户端,其图形用户界面是由Qt所写成的。使用libtorrent作为后端。

qBittorrent官网:https://www.qbittorrent.org/

qBittorrent项目地址:https://github.com/qbittorrent/qBittorrent

一.安装依赖

依次执行以下命令

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

二.安装libtorrent

Libittorrent 是 qBittorrent 的后端主程序,在大流量、长时间和大量的种子的场景下,Libittorrent 的性能直接决定着 qBittorrent 的稳定性和性能。

libtorrent项目地址:https://github.com/arvidn/libtorrent

1.下载解压libtorrent源码包

1.wget https://github.com/arvidn/libtorrent/releases/download/v1.2.14/libtorrent-rasterbar-1.2.14.tar.gz
2.tar -zxvf libtorrent-rasterbar-1.2.14.tar.gz

2.编译安装

如果VPS内存过小的话可能导致编译失败,建议编译前设置点swap交换分区

cd libtorrent-rasterbar-1.2.14
./configure --disable-debug --enable-encryption --with-libgeoip=system CXXFLAGS=-std=c++14
make -j$(nproc)
make install
ldconfig

三.安装qBittorrent

1.下载解压qBittorrent源码包

wget https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-4.3.6.tar.gz
tar -zxvf release-4.3.6.tar.gz

2.编译安装

cd qBittorrent-release-4.3.6/
./configure --disable-gui --disable-debug
make -j$(nproc)
make install

四.设置开机启动

vim /etc/systemd/system/qbittorrent.service
在里面写入一下内容:
[Unit]
Description=qBittorrent Daemon Service
After=network.target

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

[Install]
WantedBy=multi-user.target

启动qbittorrent:systemctl start qbittorrent

设置开机自启:systemctl enable qbittorrent

OK

默认端口是8080
默认用户名是admin
默认密码是adminadmin
登陆后可修改