贝隆

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

op安装

## 查看已有wsl

wsl -l -o

Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
Ubuntu-24.04 Ubuntu 24.04 LTS

## 安装Ubuntu-24.04

wsl --install  Ubuntu-24.04

wsl --shutdown

## 导出已安装ubuntu到新的目录

wsl --export Ubuntu-24.04 D:\wsl2\images\ubuntu2404.vhdx --vhd

wsl --unregister Ubuntu-24.04

## 导入vhdx创建新的ubuntu

#wsl --import <新发行版名称> <目标路径> <导出文件路径>
wsl --import Ubuntu-24.04 D:\wsl2-ubuntu2404 D:\wsl2\images\ubuntu2404.vhdx --vhd

## 安装openclaw

bash
cd /etc
nano wsl.conf  # 如果文件不存在,此命令会自动创建

在文件中添加以下内容:

text
[user]
default=<新用户名>
usermod -aG sudo <新用户名>

 

执行关机

wsl --terminate <发行版名称>

wsl -t Ubuntu-24.04

使用清华源

编辑

/etc/apt/sources.list

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse


执行

# 更新软件包列表
sudo apt update

# 升级已安装的软件包
sudo apt upgrade -y

安装openclaw

sudo curl -fsSL https://molt.bot/install.sh | bash

 运行初始化向导 安装完成后,执行初始化向导,并使环境变量生效:

openclaw onboard --install-daemon
source ~/.bashrc

Dashboard URL: http://127.0.0.1:18789/
Copied to clipboard.
No GUI detected. Open from your computer:
ssh -N -L 18789:127.0.0.1:18789 xiaof@<host>
Then open:
http://localhost:18789/
Docs:
https://docs.openclaw.ai/gateway/remote
https://docs.openclaw.ai/web/control-ui

FAQ: https://docs.openclaw.ai/start/faq

# 检查命令路径
which openclaw

# 查看版本信息
openclaw --version

# 检查网关服务状态
openclaw gateway status

 openclaw dashboard

 

停止

# 1. 停止 OpenClaw 网关(最常用) openclaw gateway stop # 2. 停止 OpenClaw 仪表盘 openclaw dashboard stop # 3. 停止 OpenClaw 守护进程(开机自启的核心进程) openclaw daemon stop # 4. 一键停止所有 OpenClaw 相关服务(部分版本支持) openclaw service stop

 

 https://cloud.tencent.com/developer/article/2626160

https://cloud.tencent.com/developer/article/2626160

 

 https://zhuanlan.zhihu.com/p/2008182925712183676

posted on 2026-03-03 09:43  贝隆  阅读(7)  评论(0)    收藏  举报