文档/安装 wantasticd5 分钟所有平台

更新、回滚和卸载

每个操作系统一行命令即可更新或卸载 wantasticd。另外还介绍:自动更新的工作方式、如何关闭、回滚到上一个二进制文件,以及清除所有数据。

完成后你将得到

你可以用一条命令更新或移除 wantasticd,在一分钟内从失败的更新中恢复,并控制自动更新。

开始之前

  • 设备上的 root 或管理员权限。

一行命令更新或卸载

选择你的系统。更新会保留认领信息和设置。卸载同样会保留配置,因此以后重新安装时会以同一台设备的身份重新连接。

更新 / 卸载bash
# update
sudo wantasticd update
# uninstall (keeps the config)
curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --uninstall
wantasticd update
$ sudo wantasticd update
Updating from v1.0.53+9c1e2aa to v1.0.54+377f3c0...1
2026/10/29 09:20:11 Running update script for version v1.0.54+377f3c0 (target: /usr/local/bin/wantasticd, log: /tmp/wantasticd-update-3141.log)...
$ wantasticd version
wantasticd version v1.0.54+377f3c0
$ sudo wantasticd update
No newer release available: current=v1.0.54+377f3c0 offered=v1.0.54+377f3c02
  1. 1发现更新的版本
  2. 2已是最新版本
更新在后台运行。服务会以新版本重启。

提示: 卸载不会将设备从你的账户中移除。请在控制台 Devices 窗口中删除它(设备行 → Delete)以释放名额。

移除所有内容(清除)

--purge 还会删除配置和设备密钥。之后重新安装时需要重新认领。

清除bash
# Linux / macOS
curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --purge
# OpenWrt / Alpine / BusyBox (as root)
wget -qO- https://get.wantastic.app/install.sh | sh -s -- --purge
Windows(在卸载命令之后)powershell
Remove-Item -Recurse -Force 'C:\ProgramData\Wantastic'
平台--uninstall 会移除--purge 还会移除
Linux(systemd)单元、二进制文件(以及 .previous/.new)、运行中的进程/etc/wantastic、/usrdata/wantastic
OpenWrt / OpenRC / SysV/etc/init.d/wantasticd 及其运行级别链接、二进制文件/etc/wantastic
BusyBoxinit 脚本、inittab 行(然后运行 kill -HUP 1)、二进制文件/etc/wantastic
macOSLaunchDaemon 和 LaunchAgent 的 plist 文件、二进制文件/Library/Application Support/Wantastic、/Library/Logs/Wantastic
卸载
$ curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --uninstall
=== Uninstalling wantasticd ===
Removed "/etc/systemd/system/multi-user.target.wants/wantasticd.service".
Configuration kept (use --purge to remove it).1
wantasticd uninstalled.
  1. 1配置已保留
不使用 --purge 时配置会保留,因此以后重新安装时会以同一台设备的身份重新连接。

自动更新的工作方式

  • 自动更新默认开启。守护进程在启动 1 分钟后检查新版本,之后每小时检查一次。
  • 它只安装更新的版本,绝不降级。
  • 它会将旧的二进制文件保留为 .previous,重启服务并检查其是否正常。如果不正常,则恢复旧的二进制文件。
  • 失败会被记录,并在下一次每小时检查时重试。

关闭自动更新

在服务运行的命令中添加 --no-auto-update。

覆盖 ExecStartbash
sudo systemctl edit wantasticd
# [Service]
# ExecStart=
# ExecStart=/usr/local/bin/wantasticd connect --config "/etc/wantastic/config.conf" --no-auto-update
sudo systemctl restart wantasticd
wantasticd status | grep 'Auto update'

注意: 重新运行安装程序会重写服务,且不带 --no-auto-update。之后请重新应用你的修改。

回滚到上一个二进制文件

每次安装和更新都会将旧的二进制文件以 .previous 的形式保留在当前文件旁边。

回滚bash
sudo systemctl stop wantasticd
sudo mv /usr/local/bin/wantasticd.previous /usr/local/bin/wantasticd
sudo systemctl start wantasticd

警告: 自动更新会在一小时内再次将你升级到新版本。如需停留在旧版本,请关闭自动更新(见上文),并告知支持团队哪个版本出现了问题。

验证结果

更新后:wantasticd version 显示新版本,status 显示 Connected。
关闭更新后:wantasticd status 显示 Auto update: false。
卸载后:which wantasticd 没有任何输出,服务也已不存在。

常见问题

更新失败,旧版本继续运行。Self-update failed; agent remains active and will retry on the next scheduled check: …服务日志
原因

下载、校验或重启失败。代理继续以当前版本运行。

解决方法

查看更新日志,解决问题原因(网络、磁盘空间),然后再次更新。

查看日志,然后重试bash
ls -t /tmp/wantasticd-update-*.log | head -n 1 | xargs tail -n 50
sudo wantasticd update
更新自动回滚了。Error: updated service failed health verification; restoring previous binary更新日志
原因

新版本未能正常启动,已恢复为上一个版本。

解决方法

设备上无需修复。请将版本号告知支持团队,并在修复版本发布前关闭自动更新。

在容器或自定义服务中,更新拒绝运行。Error: no supported service manager found; refusing an unverifiable update更新日志
原因

没有可重启的 launchd、systemd、procd、OpenRC 或 init.d 服务。

解决方法

使用 --no-auto-update,并通过替换二进制文件(或重新构建镜像)来更新。

文件系统已满或为只读时,更新失败。Error: cannot write to /usr/bin (check permissions)更新日志
原因

二进制文件所在目录为只读或已满("Error: cannot back up <bin>" 也是同一问题)。

解决方法

释放一些空间,然后再次更新。

检查空间,然后重试bash
df -h
sudo wantasticd update
更新超时。update attempt timed out after 7m0s (log kept at /tmp/wantasticd-update-XXXX.log)服务日志
原因

链路非常慢,或服务重启卡住了。

解决方法

在链路状况较好时手动运行更新。对于慢速链路,请调高 WANTASTIC_UPDATE_DOWNLOAD_TIMEOUT。

重试bash
sudo wantasticd update
自行构建的二进制文件拒绝更新。Invalid update version: parse current version: version "dev" is not major.minor.patchwantasticd update
原因

本地构建的版本显示为 dev。

解决方法

使用安装程序安装官方发布版本。

安装官方发布版本bash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh
Windows 更新已回滚。update-finish: wantasticd unhealthy after update to <v>: …; restoring previous binaryWindows 更新助手
原因

新服务未能正常启动。有问题的版本被保留为 wantasticd.exe.failed。

解决方法

不紧急,上一个版本仍在运行。如果你还看到 "update-finish: previous binary did not start either",请使用 install.ps1 -Token 重新安装。

在 Windows 上无法删除服务。[SC] DeleteService FAILED 1072: The specified service has been marked for deletion.sc.exe
原因

services.msc 或其他工具仍打开着该服务。

解决方法

关闭 services.msc 和事件查看器,或重启电脑。然后再次运行卸载命令。

继续阅读

仍然无法解决?

请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。

hello@wantastic.app