libiconv解决办法:https://github.com/qbittorrent/qBittorrent/issues/11723
注意:

  1. 一定别先安装lnmp。由于lnmp编译安装了libiconv,会导致qbittorrent编译失败。
    2.如果安装了,按照上面链接最后给出的方法解决,并且需要重新安装php。
  2. c++最低强制为c++17
    ##环境要求
apt install build-essential pkg-config automake libtool git zlib1g-dev libssl-dev libgeoip-dev
apt install libboost-dev libboost-system-dev libboost-chrono-dev libboost-random-dev
apt install qtbase5-dev qttools5-dev libqt5svg5-dev

编译libtorrent

wget https://github.com/arvidn/libtorrent/releases/download/v1.2.12/libtorrent-rasterbar-1.2.12.tar.gz
tar xf libtorrent-rasterbar-1.2.12.tar.gz
cd libtorrent-rasterbar-1.2.12
./configure --disable-debug --enable-encryption --with-libgeoip=system CXXFLAGS=-std=c++17
make -j$(nproc)
make install
ldconfig

编译qbittorrent

cd
git clone https://github.com/qbittorrent/qBittorrent
cd qBittorrent
git checkout v4_3_x
./configure --disable-gui CXXFLAGS="-std=c++17"
make -j$(nproc)
make install

设置开机启动

nano /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

启用以上设置:

systemctl enable qbittorrent.service

启动 qbittorrent 首次启动 请安 y 接受确认

qbittorrent-nox

接着按 Ctrl+c 退出,启动后台运行

systemctl start qbittorrent.service

至此 qbittorrent 安裝完成

访问 WebUI:http://你的IP:8080/ 默认用户名:admin 默认密码:adminadmin

关闭 qBittorrent 命令:

systemctl stop qbittorrent.service

启动 qBittorrent 命令:

systemctl start qbittorrent.service

重启 qBittorrent 命令:

systemctl restart qbittorrent.service
最后修改:2021 年 08 月 26 日
如果觉得我的文章对你有用,请随意赞赏