OpenCloudOS9基于RHEL9,官方一键bash脚本无法直接适配dnf源,优先采用【源码手动部署】(最稳),分4大步,全程root/普通用户均可(推荐普通用户)。
Hermes硬性依赖:Python3.11、Node22、ffmpeg、ripgrep、git、uv
一、系统预装系统依赖(dnf)
bash
#1 更新系统+安装EPEL源(必备)
sudo dnf update -y
sudo dnf install epel-release -y
#2 安装系统底层依赖
sudo dnf install -y git ffmpeg ffmpeg-devel ripgrep gcc openssl-devel \
bzip2-devel libffi-devel make cmake wget unzip
校验基础软件
bash
ffmpeg -v; rg --version; git --version
二、安装Node.js 22(必须v22,系统自带node版本太低)
OpenCloudOS9官方源node最高18,手动安装node22:
bash
#导入node22官方源
curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -
sudo dnf install nodejs -y
node -v #输出v22.x.x即正常
三、安装uv包管理器(Hermes专用Python环境管理)
bash
#国内加速安装uv
curl -LsSf https://astral.sh/uv/install.sh | sh
#写入环境变量
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
uv --version
四、源码编译安装Hermes-Agent(核心步骤)
bash
#1 克隆源码(带子模块,必加--recurse-submodules)
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git ~/hermes-agent
cd ~/hermes-agent
#2 uv自动拉取Python3.11、创建独立虚拟环境
uv python install 3.11
uv venv --python 3.11 .venv
source .venv/bin/activate
#3 全量安装Hermes所有依赖
uv pip install -e ".[all]"
#4 全局生成hermes软链接(任意目录可执行hermes命令)
mkdir -p ~/.local/bin
ln -sf $(pwd)/.venv/bin/hermes ~/.local/bin/hermes
source ~/.bashrc
五、初始化配置&启动
bash
#1 环境自检(排查缺项)
hermes doctor
#2 配置大模型密钥(Kimi/Deepseek/Ollama/OpenAI任选其一)
hermes setup
#3 启动对话
hermes chat
六、Docker极简安装(不想编译选这个,OpenCloudOS9通用)
bash
#安装docker
sudo dnf install docker-ce docker-ce-cli containerd.io --nobest -y
sudo systemctl enable --now docker
sudo usermod -aG docker $USER;newgrp docker
#拉取镜像启动
docker pull nousresearch/hermes-agent:latest
mkdir -p ~/.hermes/config
docker run -d --name hermes-agent -v ~/.hermes/config:/root/.hermes nousresearch/hermes-agent:latest
#进入容器配置
docker exec -it hermes-agent hermes setup
七、常见报错处理
- hermes doctor提示缺少ffmpeg/rg:重新执行第一步dnf安装命令
- node版本不足 :重装node22,禁用系统默认node模块:
sudo dnf module disable nodejs -y - git克隆超时:换国内镜像仓库克隆
bash
git clone https://gitee.com/mirrors/hermes-agent.git ~/hermes-agent
cd ~/hermes-agent && git submodule update --init --recursive
- PATH不生效 :
source ~/.bashrc或重启终端