Yunzai Linux搭建教程
Linux 前言
Ubuntu 通用版本教程 注意:此教程要有一定的Linux基础,如没有请往下看宝塔安装教程
本教程的环境 腾讯云的Ubuntu (版本22.04)
1.安装node.js
1 2 3 sudo apt install apt-transport-https curl ca-certificates software-properties-commoncurl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs
2.安装redis
1 sudo apt install redis-server
1 sudo systemctl status redis-server
3.安装git
1 sudo apt-get install git
4.拉取仓库
1 git clone --depth=1 -b main https://gitee.com/yoimiya-kokomi/Yunzai-Bot.git
5.安装依赖
6.启动云崽
Ubuntu 20.04教程(采用宝塔)
本文的环境: 纯净的Ubuntu(版本20.04)
1. 安装宝塔面板
为什么要安装宝塔面板?
因为便于管理文件(更改配置文件、上传面板图等)
使用以下命令安装:
1 wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && sudo sh install.sh ed8484bec
安装完成后,记得保存输出的面板地址和账号密码
2. 安装Nodejs与redis
安装好后,点击右侧的模块管理,来到下图所示界面,按图操作
安装完成,回到软件商店,搜索redis,按下图操作
3. 安装Yunzai
回到SSH终端,安装GIT,以便拉取仓库
执行以下命令:
1 sudo apt-get install git
等待执行完成
然后拉取Yunzai,使用以下命令:
1 git clone --depth=1 -b main https://gitee.com/Le-niao/Yunzai-Bot.git
大致输出以下内容(没有ERR或error就不用管)
1 2 3 4 5 6 7 8 Cloning into 'Yunzai-Bot'... remote: Enumerating objects: 1073, done. remote: Counting objects: 100% (1073/1073), done. remote: Compressing objects: 100% (1053/1053), done. remote: Total 1073 (delta 25), reused 911 (delta 2), pack-reused 0Receiving objects: 100% (1073/1073), 18.37 MiB | 9.07 MiB/s Receiving objects: 100% (1073/1073), 27.20 MiB | 11.79 MiB/s, done. Resolving deltas: 100% (25/25), done. Updating files: 100% (992/992), done.
输出大致如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. Packages: +362 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Packages are hard linked from the content-addressable store to the virtual store. Content-addressable store is at: /root/.local/share/pnpm/store/v3 Virtual store is at: node_modules/.pnpm Progress: resolved 498, reused 497, downloaded 0, added 362, done dependencies: + art-template 4.13.2 + chalk 5.0.1 + chokidar 3.5.3 + https-proxy-agent 5.0.1 + inquirer 8.2.4 + lodash 4.17.21 + log4js 6.5.2 + md5 2.3.0 + moment 2.29.3 + node-fetch 3.2.6 + node-schedule 2.1.0 + node-xlsx 0.21.0 + oicq 2.3.1 + patch-package 6.5.0 + pm2 5.2.0 + puppeteer 13.7.0 + redis 4.1.0 + yaml 2.1.1 devDependencies: skipped Done in 13.5s
CentOS 7.9.2111教程:
1. 安装Nodejs
使用dnf安装fedora的epel-release插件
1 dnf install epel-release
1 curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo sh -
1 dnf module install nodejs:16 -y
1 2 [root@CentOS7.9.2111 ~]# node -v v16.19.0
2. 安装redis
1 yum -y install redis && redis-server --daemonize yes
如果像下图一样报错,那么是你没安装epel,返回上文查看命令
3. 安装GIT
4. 克隆仓库
1 git clone --depth=1 -b main https://gitee.com/Le-niao/Yunzai-Bot.git
1 git clone --depth=1 -b main https://github.com/Le-niao/Yunzai-Bot.git
5. 安装依赖
1 yum install pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y && yum install libdrm libgbm libxshmfence -y && yum install nss -y && yum update nss -y
6. 安装中文字体,顺便把系统语言切换为中文 1 yum groupinstall fonts -y
1 localectl set-locale LANG=zh_CN.UTF-8
7. 启动Yunzai并按提示操作即可