#教程 #openwrt #Linux #bash
本指南适用于 iStoreOS(基于 OpenWrt),确保你的系统可以正确安装 Git、Go 1.22,并成功运行 q。1. 安装 Git 并启用 HTTPS 支持
opkg update opkg install git git-http ca-certificates 检查 Git 是否安装成功:
git --version 如果输出类似:
git version 2.x.x 说明安装成功。
2. 安装 Go (1.22)
cd /tmp wget https://go.dev/dl/go1.22.0.linux-arm64.tar.gz mkdir -p /opt/go tar -C /opt/go -xzf go1.22.0.linux-arm64.tar.gz echo 'export PATH=/opt/go/go/bin:$PATH' >> ~/.profile source ~/.profile 检查安装是否成功:
go version 应输出:
go version go1.22.0 linux/arm64 3. 克隆 q 源代码
git clone https://github.com/natesales/q.git cd q 4. 编译并安装 q
go install github.com/natesales/q@latest 5. 确保 q 在 PATH 中
echo 'export PATH=$(go env GOPATH)/bin:$PATH' >> ~/.profile source ~/.profile 6. 验证安装
q --version 如果输出 q 的版本号,说明安装成功!
7. 如果 q 仍然找不到
运行:
echo $PATH go env GOPATH ls -l $(go env GOPATH)/bin/q 如果 q 安装成功但找不到,可以手动移动到 /usr/local/bin:
mv $(go env GOPATH)/bin/q /usr/local/bin/ 然后再次尝试运行:
q --version 现在,你可以在 iStoreOS 上使用 q 了!