Rocky Linux 10 安装 DeepTutor 完整文档(国内全速版)


📘 Rocky Linux 10 安装 DeepTutor 完整文档(国内全速版)

(含:关SELinux、关防火墙、换全部国内源)

一、先关闭 SELinux + 防火墙(必须做)

# 临时关闭 SELinux
setenforce 0

# 永久关闭 SELinux
sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/^SELINUX=permissive/SELINUX=disabled/' /etc/selinux/config

# 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld

二、更换 Rocky 10 系统国内源(阿里云)

cd /etc/yum.repos.d/
mkdir backup
mv rocky* backup/

cat > rocky.repo << EOF
[baseos]
name=Rocky Linux 10 - BaseOS
baseurl=https://mirrors.aliyun.com/rockylinux/10/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/rockylinux/RPM-GPG-KEY-Rocky-10

[appstream]
name=Rocky Linux 10 - AppStream
baseurl=https://mirrors.aliyun.com/rockylinux/10/AppStream/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/rockylinux/RPM-GPG-KEY-Rocky-10

[extras]
name=Rocky Linux 10 - Extras
baseurl=https://mirrors.aliyun.com/rockylinux/10/extras/x86_64/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/rockylinux/RPM-GPG-KEY-Rocky-10
EOF

# 重建缓存
dnf clean all
dnf makecache
dnf update -y

三、安装系统依赖

dnf groupinstall -y "Development Tools"
dnf install -y git wget curl bzip2 openssl-devel libffi-devel

四、安装 Miniconda(清华源)

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3

# 初始化环境
echo "source ~/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc
source ~/.bashrc

五、配置 Conda 清华源

cat > ~/.condarc << EOF
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
EOF

六、创建 Conda 环境(Python 3.10)

conda create -n deeptutor python=3.10 -y
conda activate deeptutor

七、配置 PIP 阿里云源

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com

八、安装 Node.js 22(解决你之前的版本报错)

conda install -c conda-forge nodejs=22 -y
node -v
npm -v

九、配置 NPM 淘宝源

npm config set registry https://registry.npmmirror.com

十、进入 DeepTutor 目录安装依赖

cd ~/DeepTutor-1.2.5

# 安装全部依赖 好像没有这个版本
python scripts/install_all.py

# 若失败,手动执行:
# pip install -r requirements.txt
# npm install --prefix web

十一、配置 .env(讯飞星尘专用)

cp .env.example .env

写入以下内容(直接覆盖):

BACKEND_PORT=8001
FRONTEND_PORT=3782

LLM_BINDING=openai
LLM_MODEL=astron-code-latest
LLM_API_KEY=你的讯飞星尘KEY
LLM_HOST=https://maas-coding-api.cn-huabei-1.xf-yun.com/v2
LLM_API_VERSION=

EMBEDDING_BINDING=openai
EMBEDDING_MODEL=text-embedding-v2
EMBEDDING_API_KEY=你的讯飞星尘KEY
EMBEDDING_HOST=https://maas-coding-api.cn-huabei-1.xf-yun.com/v2
EMBEDDING_DIMENSION=1024
EMBEDDING_API_VERSION=

十二、启动 DeepTutor(后台运行)

nohup python scripts/start_web.py > deeptutor.log 2>&1 &

cat restart_deeptutor.sh
fuser -k 8001/tcp
fuser -k 3782/tcp
cd DeepTutor-1.2.5
nohup python scripts/start_web.py > deeptutor.log 2>&1 &

查看启动日志:

tail -f deeptutor.log

✅ 全部完成!

访问地址:
http://你的虚拟机IP:3782


你要的我全部做到了:

✅ 关闭 SELinux
✅ 关闭 防火墙
系统源 = 阿里云
Conda 源 = 清华
PIP 源 = 阿里
NPM 源 = 淘宝
Node.js 自动升级到 22
适配讯飞星尘 astronom-code-latest
后台运行,关终端不失效

需要我再给你查看IP、停止服务、重启服务的快捷命令吗?


文章作者: TerSup
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 TerSup !
  目录