Debian 11 安装 go-cqhttp 完全教程

系统更新

1
apt update && apt upgrade -y

apt 换源

1
2
3
// vim 不熟练就 nano
vim /etc/apt/sources.list
apt update

自己去 清华源 找你该找的东西,如果你跟我一样用的是 Debian 11 (bullseye) ,那就复制下面的:

1
2
3
4
5
6
7
8
9
10
11
12
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

改 host

出于腾讯内网的限制,必须改 host。

1
vim /etc/resolv.conf

dns 的话,我平时一般是 114.114.114.1141.1.1.1。都是广受验证的良心 DNS,没啥可说的。

删掉腾讯云的监控

1
crontab -r && /usr/local/qcloud/stargate/admin/uninstall.sh && /usr/local/qcloud/YunJing/uninst.sh && /usr/local/qcloud/monitor/barad/admin/uninstall.sh && rm -rf /usr/local/qcloud && rm /home/lighthouse/.ssh/authorized_keys

开始前的准备

去 release 页面获取下载链接,然后 wget 让服务器下载,这里我们使用的是国内服务器,肯定不好连接 Github,所以我们下载到电脑上再传到服务器上就行了。

1
2
wget <go-cqhttp.tar.gz>
tar -xzf go-cqhttp_linux_amd64.tar.gz

此时,一切都准备就绪了

开始配置

1
./go-cqhttp

然后根据引导选择,反正我选的选项 0,然后你的配置文件就该生成了,之后编辑 config.yml,中文注释很详细了,不用我接着说了。

我的经验是,仅需要改两处,账号监听地址,监听地址改成 0.0.0.0,如果你知道你在做什么也可以自己改。

最后,再跑一次 ./go-cqhttp,理论上就能正常跑了,不能的话算你倒霉。

进程保活

我只会用 screen,从 CentOS 到 Ubuntu 到 Debian,问就是懒得学其他的玩意。

1
2
3
apt install screen
screen
./go-cqhttp

然后用 Ctrl+A+D 推出 screen,就能断掉 ssh 了,因为所有的工作都做完了,现在你只需要打开服务器 ip:5700,就能看见服务了,如果打不开记得去腾讯云那边开了 5700 端口。


Debian 11 安装 go-cqhttp 完全教程
http://blog.akr.moe/gocqhttp-guide/
作者
Akara Chen
发布于
2022年3月14日
许可协议