---
title: "安装程序错误（install.sh 和 install.ps1） | Wantastic Docs"
description: "Wantastic 安装程序停止时输出的每条消息、其含义以及最简单的修复方法。"
url: "https://wantastic.app/zh/docs/errors-installer"
category: "Troubleshooting"
reading_time: "6 分钟"
---

# 安装程序错误（install.sh 和 install.ps1）

Wantastic 安装程序停止时输出的每条消息、其含义以及最简单的修复方法。

> **Outcome:** 安装程序结束时输出 "Done. wantasticd <version> is installed and running."，且设备已认领。

## Before you start

- Linux 和 macOS 上使用 sudo，OpenWrt 和 Alpine 上使用 root shell，Windows 上以管理员身份运行 PowerShell。

## 开始之前

- 以 "Error:" 开头的行会使安装程序停止，以 "Warning:" 开头的行不会。
- 重复运行安装程序是安全的。它会保留你的配置，并将旧的二进制文件保存为 .previous。
- 大多数错误都可以通过使用 sudo 运行快速安装来解决，命令与下方完全一致。

Linux 和 macOS:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

OpenWrt 和 Alpine（以 root 身份）:

```bash
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
```

## 检查要点

1. 权限错误（"not writable"、"needs root"）：在 sh 前加上 sudo。
2. 下载错误（"HTTP …"、"wget failed"、"latest version"）：检查 DNS、HTTPS 和时钟。
3. 最后出现服务错误：运行 genkey，认领设备，然后重启服务。

*失败：没有 sudo: 没有 sudo，安装程序无法写入 /usr/local/bin。*

```
$ $ curl -fsSL https://get.wantastic.app/install.sh | sh
Platform: linux/amd64
Error: /usr/local/bin is not writable, but / is already read-write. Run this installer as root.
```

*已修复：在 sh 前加 sudo，然后运行 genkey: 使用 Claim URL 或二维码认领设备，按 Ctrl+C，然后重启。*

```
$ $ curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
Done. wantasticd v1.0.54+377f3c0 is installed and running.
Claim URL: https://console.wantastic.app/#desktop?claim_public_key=Vd3hK1oQ…&wantastic_server=https://console.wantastic.app
Device claimed. Configuration saved to /etc/wantastic/config.conf
$ $ sudo systemctl restart wantasticd
```

## 速查表

| 错误 | 最简单的修复方法 |
| --- | --- |
| Unsupported OS: X | 在 Windows 上请使用 install.ps1。 |
| Unsupported architecture: X | 从匹配的 tarball 手动安装。 |
| Error: on macOS the installer needs root. | 在 sh 前加上 sudo。 |
| Error: <dir> is not writable… | 在 sh 前加上 sudo，或以 root 身份运行。 |
| Error: could not remount <mount> read-write… | 以 root 身份运行；锁定的固件需要一个可写路径。 |
| Error: <dir> is still not writable after remounting <mount> | 释放闪存空间。 |
| Error: curl or wget required | 安装 curl 或 wget。 |
| HTTP <code> downloading <url> / wget failed: <url> | 修复 DNS、CA 证书包、时钟或代理。 |
| Error: could not determine latest version | 检查能否访问 get.wantastic.app。 |
| Error: invalid release version: X | 登录强制门户，或绕过代理。 |
| Error: binary not found in archive | 释放 /tmp 空间后重试。 |
| Error: downloaded binary does not report target version V | CPU 构建版本不匹配，或 /tmp 挂载为 noexec。 |
| Skipping login… / … is empty / service did not start | 运行 genkey，认领设备，重启服务。 |
| Error: OpenRC service was not enabled | rc-update add wantasticd default。 |
| Bootstrap failed: 5: Input/output error | 先执行 launchctl bootout，再重新运行。 |

## Verify the result

- 安装程序输出 "Done. wantasticd <version> is installed and running."
- 点击 Claim Device 后，genkey 输出 "Device claimed"。
- 重启后 wantasticd status 显示 Connected。

## Common issues

### 安装程序拒绝在 Windows 上运行。

```
Unsupported OS: X
```

- **Where:** install.sh
- **Likely cause:** install.sh 仅支持 Linux 和 macOS。
- **Fix:** 请改用 install.ps1：以管理员身份打开 PowerShell 并粘贴这一行。

PowerShell（管理员）:

```powershell
irm https://get.wantastic.app/install.ps1 | iex
```

- **Verify:** 安装程序提示服务已作为 Windows 服务安装并运行。

### 无法识别架构。

```
Unsupported architecture: X
Download manually from https://get.wantastic.app
```

- **Where:** install.sh
- **Likely cause:** 该 CPU 类型（例如 ppc64、s390x 或 loong64）没有自动构建版本。
- **Fix:** 下载匹配的 tarball 并安装，然后使用 genkey 认领设备。

Shell:

```bash
TAG=$(curl -fsSL https://get.wantastic.app/latest | cut -d+ -f1)
curl -fsSLO https://get.wantastic.app/$TAG/wantasticd-linux-<arch>.tar.gz
tar -xzf wantasticd-linux-<arch>.tar.gz
sudo install -m 755 wantasticd /usr/local/bin/
sudo wantasticd genkey
```

- **Verify:** genkey 输出 "Device claimed"。

### macOS 安装立即停止。

```
Error: on macOS the installer needs root.
```

- **Where:** install.sh (macOS)
- **Likely cause:** 安装程序没有使用 sudo 运行。
- **Fix:** 在 sh 前加上 sudo 运行快速安装，然后认领设备。

1. 运行该命令。
2. 打开 Claim URL，登录并点击 Claim Device。
3. 出现 "Device claimed" 后，按 Ctrl+C。
4. 运行：sudo launchctl kickstart -k system/com.wantastic.wantasticd

Terminal:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

- **Verify:** wantasticd status 显示 Connected。

### 安装目录不可写。

```
Error: <dir> is not writable. Run this installer as root.
```

- **Where:** install.sh
- **Likely cause:** 安装程序没有以 root 身份运行。
- **Fix:** 使用 sudo 运行快速安装（在 OpenWrt 和 Alpine 上，以 root 身份登录）。

Shell:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

- **Verify:** 安装程序输出 "Done."，genkey 显示 Claim URL。

### 文件系统正常，但 Linux 单行命令仍然失败。

```
Error: <dir> is not writable, but <mount> is already read-write. Run this installer as root.
```

- **Where:** install.sh
- **Likely cause:** sudo 加在了 curl 前面或被遗漏，导致 sh 以普通用户身份运行。
- **Fix:** 将 sudo 加在 sh 前面，而不是 curl 前面。

Shell:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

- **Verify:** 安装程序输出 "Done."

### 安装程序无法将只读文件系统改为可写。

```
Error: could not remount <mount> read-write. Run as root or unlock the filesystem.
```

- **Where:** install.sh（嵌入式）
- **Likely cause:** 固件为只读或已锁定，或你不是 root。
- **Fix:** 以 root 身份运行。如果固件仍为只读，请将二进制文件手动安装到可写目录，并设置 WANTASTIC_CONFIG_DIR。

- **Verify:** wantasticd version 可以运行。

### 重新挂载成功，但安装程序仍无法写入。

```
Error: <dir> is still not writable after remounting <mount>
```

- **Where:** install.sh
- **Likely cause:** 闪存或分区已满。
- **Fix:** 释放约 15 MB 空间，然后重新运行安装程序。

Shell:

```bash
df -h
df -h /overlay
```

- **Verify:** 安装程序输出 "Done."

### 结束时出现只读恢复警告。

```
Warning: could not remount <mount> read-only
```

- **Where:** install.sh
- **Likely cause:** 安装程序已将文件系统改为可写，但无法切换回只读。安装本身已成功。
- **Fix:** 方便时重启设备。

- **Verify:** 重启后 mount 显示该文件系统为 ro。

### 安装程序找不到挂载点。

```
Error: could not determine the mount containing <dir>
```

- **Where:** install.sh
- **Likely cause:** 设备的挂载布局不常见。
- **Fix:** 将二进制文件手动安装到 PATH 中的可写目录，然后运行 genkey。

- **Verify:** wantasticd version 正常运行。

### 没有下载工具。

```
Error: curl or wget required
```

- **Where:** install.sh
- **Likely cause:** 系统镜像中既没有 curl 也没有 wget。
- **Fix:** 安装其中一个，然后重新运行快速安装。

Shell:

```bash
apt-get install -y curl                          # Debian/Ubuntu
apk add curl ca-certificates                     # Alpine
opkg update && opkg install wget-ssl ca-bundle   # OpenWrt
```

- **Verify:** curl --version 或 wget --version 可以正常运行。

### 下载失败并返回 HTTP 状态码。

```
HTTP <code> downloading <url>
```

- **Where:** install.sh
- **Likely cause:** DNS、HTTPS（缺少 CA 证书包或时钟错误）、代理或防火墙阻止了下载。
- **Fix:** 使用以下命令检查 DNS、时钟和 HTTPS。

Shell:

```bash
nslookup get.wantastic.app
date -u
curl -v https://get.wantastic.app/latest
```

- **Verify:** 最后一条命令输出类似 v1.0.54+377f3c0 的版本号。

### 在 OpenWrt 或 BusyBox 上 wget 下载失败。

```
wget failed: <url>
```

- **Where:** install.sh
- **Likely cause:** wget 不支持 HTTPS、缺少 CA 证书包，或时钟错误。
- **Fix:** 安装 HTTPS 支持并设置时钟。

Shell:

```bash
opkg update && opkg install wget-ssl ca-bundle
ntpd -q -p pool.ntp.org
```

- **Verify:** wget -qO- https://get.wantastic.app/latest 输出版本号。

### 无法获取最新版本。

```
Error: could not determine latest version
```

- **Where:** install.sh（install.ps1："Could not determine latest version."）
- **Likely cause:** 设备无法访问 https://get.wantastic.app/latest。
- **Fix:** 检查 DNS、HTTPS 和代理，然后重试。

Shell:

```bash
curl -fsSL https://get.wantastic.app/latest
```

- **Verify:** 输出了版本号字符串。

### 版本号看起来像一个网页。

```
Error: invalid release version: X
```

- **Where:** install.sh（install.ps1："Invalid release version: X"）
- **Likely cause:** 强制门户或代理返回了网页，而不是版本号。
- **Fix:** 登录强制门户，或让 get.wantastic.app 绕过代理。

- **Verify:** curl -fsSL https://get.wantastic.app/latest 只输出版本号。

### 压缩包中没有二进制文件。

```
Error: binary not found in archive
```

- **Where:** install.sh（install.ps1："wantasticd.exe not found in archive."）
- **Likely cause:** 下载被中断，通常是因为 /tmp 已满。
- **Fix:** 释放 /tmp 空间，然后重新运行安装程序。

Shell:

```bash
df -h /tmp
```

- **Verify:** 安装程序输出 "wantasticd <version> installed."

### 下载后二进制文件无法运行。

```
Error: downloaded binary does not report target version V
Reported: …
```

- **Where:** install.sh
- **Likely cause:** /tmp 以 noexec 挂载，或 CPU 无法运行该构建版本（ARMv6 Pi Zero/Pi 1、无 FPU 的 MIPS）。
- **Fix:** 使用其他临时目录。在 ARMv6 或无 FPU 的 MIPS 上，请改用 WireGuard 配置。

Shell:

```bash
sudo mkdir -p /var/tmp/wt && curl -fsSL https://get.wantastic.app/install.sh | sudo TMPDIR=/var/tmp/wt sh; sudo wantasticd genkey
```

- **Verify:** wantasticd version 输出目标版本号。

### 重新安装时安装程序跳过了登录。

```
Config already exists at <cfg> — skipping login.
```

- **Where:** install.sh
- **Likely cause:** 这是正常现象。安装程序从不覆盖已有配置。
- **Fix:** 如需保留该设备，无需任何操作。如需将其注册为新设备，请删除配置并使用新密钥重新认领。

Shell:

```bash
sudo rm /etc/wantastic/config.conf
sudo wantasticd genkey --force
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** genkey 输出 "Device claimed"。

### 安装期间登录步骤失败。

```
Login failed — <cfg> is empty. Edit it and re-run: wantasticd login
```

- **Where:** install.sh
- **Likely cause:** 令牌被拒绝或无法连接控制台。原因会打印在此行上方。
- **Fix:** 跳过令牌，使用 genkey 认领设备。

Shell:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd status 显示 Connected。

### 安装程序在没有凭据的情况下运行。

```
Skipping login. Run 'wantasticd login' to authenticate.
```

- **Where:** install.sh
- **Likely cause:** 快速安装出现这种情况是正常的。设备仍需认领。
- **Fix:** 运行 genkey，认领设备，按 Ctrl+C，然后重启服务。

Shell:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** wantasticd status 显示 Connected。

### 同时传入了两个服务器参数。

```
Warning: both --server and --portal-url were provided; using --portal-url.
```

- **Where:** install.sh
- **Likely cause:** 这两个参数相互冲突。
- **Fix:** 只传入其中一个：证书有效时使用 --portal-url，自签名证书使用 --server。

- **Verify:** 下次运行时警告消失。

### systemd 步骤失败。

```
Error: systemd service did not start
```

- **Where:** install.sh
- **Likely cause:** 设备尚未认领，因此配置为空。认领前出现这种情况属于预期。
- **Fix:** 运行 genkey，认领设备，按 Ctrl+C，然后重启服务。

Shell:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo systemctl restart wantasticd
```

- **Verify:** systemctl is-active wantasticd 打印 active。

### systemd 单元未启用。

```
Error: systemd service was not enabled
```

- **Where:** install.sh
- **Likely cause:** 该单元已被屏蔽（masked），或 /etc 为只读。
- **Fix:** 取消屏蔽并启用该服务。

Shell:

```bash
sudo systemctl unmask wantasticd
sudo systemctl enable --now wantasticd
```

- **Verify:** systemctl is-enabled wantasticd 输出 enabled。

### 容器被识别为 systemd 环境。

```
System has not been booted with systemd as init system
```

- **Where:** systemctl（容器内）
- **Likely cause:** 容器中有 systemd 文件，但并未运行 systemd。
- **Fix:** 将 wantasticd 作为容器命令在前台运行，并提供 /dev/net/tun 和 NET_ADMIN。

Shell:

```bash
wantasticd connect --config /etc/wantastic/config.conf
```

- **Verify:** 容器内 wantasticd status 显示 Connected。

### OpenWrt procd 步骤失败。

```
Error: procd service did not become healthy
```

- **Where:** install.sh (OpenWrt)
- **Likely cause:** 设备尚未认领，或缺少 kmod-tun。
- **Fix:** 安装 kmod-tun，使用 genkey 认领设备，然后重启服务。

Shell (root):

```bash
opkg update && opkg install kmod-tun
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
```

- **Verify:** wantasticd status 显示 Connected。

### 缺少 procd 脚本。

```
Error: procd service script was not installed
```

- **Where:** install.sh (OpenWrt)
- **Likely cause:** 闪存已满或为只读，导致 /etc/init.d 不可写。
- **Fix:** 释放闪存空间，然后重新运行快速安装。

Shell (root):

```bash
df -h /overlay
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
```

- **Verify:** /etc/init.d/wantasticd 已存在。

### Alpine 服务未启用。

```
Error: OpenRC service was not enabled
```

- **Where:** install.sh (Alpine)
- **Likely cause:** rc-update 失败。
- **Fix:** 手动启用并启动该服务。

Shell (root):

```bash
rc-update add wantasticd default
rc-service wantasticd start
```

- **Verify:** rc-service wantasticd status 显示 started。

### 没有受支持的 init 系统。

```
Unknown init system — start manually: wantasticd connect --config <cfg>
```

- **Where:** install.sh
- **Likely cause:** 安装程序未找到 systemd、procd、OpenRC、SysV 或 /etc/init.d。
- **Fix:** 将打印出的命令添加到你的开机启动方式中，例如 rc.local。

- **Verify:** 重启后 wantasticd status 显示 Connected。

### macOS 安装程序提示服务未能保持运行（设备认领之前）。

```
Error: wantasticd did not stay running. Last log lines:
```

- **Where:** install.sh (macOS)
- **Likely cause:** 认领前配置为空，因此服务暂时无法启动。全新安装时出现这种情况属于预期。
- **Fix:** 忽略该消息。运行 genkey，认领设备，按 Ctrl+C，然后重启服务。

Terminal:

```bash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo launchctl kickstart -k system/com.wantastic.wantasticd
```

- **Verify:** sudo launchctl print system/com.wantastic.wantasticd 显示 state = running。

### plist 检查失败。

```
Error: invalid <plist>
```

- **Where:** install.sh (macOS)
- **Likely cause:** 生成的 LaunchDaemon 文件已损坏。
- **Fix:** 卸载后重新运行快速安装。

Terminal:

```bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --uninstall
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

- **Verify:** 安装程序输出 "Service registered with launchd and running"。

### macOS 上出现签名警告。

```
Warning: could not ad-hoc sign <bin>
```

- **Where:** install.sh (macOS)
- **Likely cause:** codesign 工具缺失或执行失败。
- **Fix:** 手动为二进制文件签名。

Terminal:

```bash
xcode-select --install
sudo codesign -f -s - /usr/local/bin/wantasticd
```

- **Verify:** codesign -dv /usr/local/bin/wantasticd 显示 Signature=adhoc。

### macOS 重新安装时出现 launchctl 错误。

```
Bootstrap failed: 5: Input/output error
```

- **Where:** launchctl (macOS)
- **Likely cause:** 旧服务仍在停止过程中。
- **Fix:** 移除旧服务，然后重新运行快速安装。

Terminal:

```bash
sudo launchctl bootout system/com.wantastic.wantasticd
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
```

- **Verify:** 安装程序输出 "Done."

## Continue with

- [Troubleshooting: start here](https://wantastic.app/zh/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
- [Choose your install method](https://wantastic.app/zh/docs/install-overview): Find your device in one table and copy one command. Most devices install in 2 minutes: install, scan a QR code, click Claim Device.
- [Manual tarball install](https://wantastic.app/zh/docs/install-manual): Install wantasticd by hand from the release archive on any Linux CPU (including ppc64, s390x and loong64), claim it with genkey, and add your own service.
- [Login, token and claim errors](https://wantastic.app/zh/docs/errors-login-claim): Fix claim problems (genkey, QR code, Claim Device), "Login failed: …" messages and token errors.
- [macOS and Windows errors](https://wantastic.app/zh/docs/errors-macos-windows): launchd, Gatekeeper, tray, sc.exe and Windows service errors with the easiest fixes.
- [OpenWrt and embedded device errors](https://wantastic.app/zh/docs/errors-openwrt-embedded): kmod-tun, read-only flash, procd, full flash, wrong clocks and BusyBox issues on routers and modules.
