qBittorrent一键安装脚本

PT 工具安装脚本

2020.7.16 更新,这个 Github 项目包含了几乎所有的 PT 工具脚本,其中 qBittorrent 可以使用 deb包安装最新版,或静态编译好的来进行安装。脚本目前支持 Debian 9/10Ubuntu 16.04/18.04. 推荐使用 Debian 10 或 Ubuntu 18.04

https://github.com/Aniverse/inexistence

bash <(wget --no-check-certificate -qO- https://github.com/Aniverse/inexistence/raw/master/inexistence.sh)

Centos 安装脚本

今天的这个一键安装脚本是安装的 4.1.1 版本,现在有更新版本的了,但我的 vps 配置较低,这又有现成脚本,所以就用这个脚本部署了

脚本仅支持 CentOS7,64 位系统!!!请使用纯净的系统安装!!!请使用 ROOT 用户执行脚本!!!

使用方法

wget https://lala.im/static/script/qBittorrentCentOS7install.sh && chmod +x qBittorrentCentOS7install.sh
./qBittorrentCentOS7install.sh

因为编译 libtorrent 的时候需要用到大量的内存,小于 2GB 的机器可能会因为内存不足导致进程被杀掉,所以在脚本内加了一个创建 swap 的功能。创建的 swap 文件保存在 /var 目录下,安装完成之后可以自己手动删除掉。

另外因为 libtorrent 编译需要比较长的时间,我加了一个设置编译时使用多个 CPU 线程的功能,根据你自己机器的 CPU 核心数来设置就行了,比如你是一个 4 核心的机器,在脚本内输入 4,那么编译的速度会变快很多!

脚本会帮你安装如下软件:

回显内容:

  • qBittorrentWEB 地址:你的机器公网 IP + 端口 8080
  • WEB 账号:admin
  • WEB 密码:adminadmin

管理命令:

systemctl start qbittorrent
systemctl stop qbittorrent
systemctl restart qbittorrent

Ubuntu 安装教程

  • 安装必要依赖
Armasm

apt-get install software-properties-common
  • 添加 qBittorrent 的源
Vim

add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
  • 安装 qBittorrent

apt-get install qbittorrent-nox
  • 启动 qBittorrent

qbittorrent-nox

然后输入 “y” 同意条款,即可启动

但是有一个问题,如果断开了 ssh 连接,或者按了 ctrl+c 的话服务就会停止,所以要创建一个系统服务。

  • 创建服务文件

vim /etc/systemd/system/qbittorrent-nox.service

在里面写入

[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
#UMask=000
Type=forking
LimitNOFILE=infinity
ExecStart=/usr/bin/qbittorrent-nox -d –webui-port=8080
ExecStop=/usr/bin/killall -s 9 /usr/bin/qbittorrent-nox
Restart=on-failure
#TimeoutSec=300

[Install]
WantedBy=multi-user.target

 

  • 依次运行以下命令

启动服务

systemctl start qbittorrent-nox

保存修改

systemctl daemon-reload

开机自启:

systemctl enable qbittorrent-nox

检验一下:

systemctl status qbittorrent-nox

如果亮绿灯证明服务已正常运行。
如果你之前使用过 qbittorrent-nox 这个命令运行并设置了一些东西,设置将不再生效。
访问服务器 IP:8080 即可进入 web 界面。

qbittorrent 网页登录密码:
账号:admin
密码:adminadmin

最后来设置一下 qBittorrent:
进入设置,
在 Web 设置里更改语言和密码。
把 BitTorrent-Torrent 排队的勾给点掉。

文章作者: 元洪
文章链接: https://gyh.im/posts/6c9f7751/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 元洪博客