打开你常用的终端模拟器,或在大多数桌面环境下按 Ctrl + Alt + T。
如果 openclaw 命令还能用,运行:
openclaw uninstall --all --yesuninstall:告诉程序「我要卸载」。--all:彻底删除,包括网关服务、本地数据库、配置文件等所有数据。--yes:全程自动确认,不需要手动按 Y。完全无交互模式(脚本/CI/npx):
openclaw uninstall --all --yes --non-interactive
npx -y openclaw uninstall --all --yes --non-interactive上面的指令跑完后,电脑里只剩 OpenClaw 的外壳(CLI 工具)。用你当初安装时的包管理器删除它:
npm rm -g openclaw
# 或者
pnpm remove -g openclaw
# 或者
bun remove -g openclaw如果 openclaw 命令已经不存在,但网关服务还在后台运行:
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload如果你用过 profile,unit 名称为 openclaw-gateway-<profile>.service,请对应调整。
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
rm -rf ~/.openclaw/workspace如果你把 OPENCLAW_CONFIG_PATH 设到了状态目录以外的位置,也需要手动删除。如果你用过 profile,对每个状态目录重复操作(如 ~/.openclaw-<profile>)。
| 类别 | 检查位置 |
|---|---|
| 配置 | ~/.config/openclaw |
| 本地 share/state | ~/.local/share/openclaw、~/.local/state/openclaw |
| 缓存 | ~/.cache/openclaw |
| 项目目录 | 与安装或运行相关的 repo / workspace |
| Shell 配置 | ~/.bashrc、~/.zshrc、~/.profile |
Linux 用户需要逐项确认这些已清理干净:
systemctl --user list-units | grep openclawsystemctl list-units | grep openclawcrontab -l | grep openclaw如果卸载后还有东西不断复活,通常说明 service 层还没处理干净。
请检查并清理:
~/.bashrc~/.zshrc~/.profile~/.bash_profile移除所有 OPENCLAW_* 环境变量、PATH 条目,以及引用 OpenClaw 的 source 行。
which openclaw
ps aux | grep openclaw
systemctl --user list-units | grep openclaw三条命令都应该没有返回结果。