更新、回滚和卸载
每个操作系统一行命令即可更新或卸载 wantasticd。另外还介绍:自动更新的工作方式、如何关闭、回滚到上一个二进制文件,以及清除所有数据。
你可以用一条命令更新或移除 wantasticd,在一分钟内从失败的更新中恢复,并控制自动更新。
开始之前
- 设备上的 root 或管理员权限。
一行命令更新或卸载
选择你的系统。更新会保留认领信息和设置。卸载同样会保留配置,因此以后重新安装时会以同一台设备的身份重新连接。
# update
sudo wantasticd update
# uninstall (keeps the config)
curl -fsSL https://get.wantastic.app/install.sh | sudo sh -s -- --uninstall$ sudo wantasticd updateUpdating from v1.0.53+9c1e2aa to v1.0.54+377f3c0...12026/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 versionwantasticd version v1.0.54+377f3c0$ sudo wantasticd updateNo newer release available: current=v1.0.54+377f3c0 offered=v1.0.54+377f3c02
- 1发现更新的版本
- 2已是最新版本
提示: 卸载不会将设备从你的账户中移除。请在控制台 Devices 窗口中删除它(设备行 → Delete)以释放名额。
移除所有内容(清除)
--purge 还会删除配置和设备密钥。之后重新安装时需要重新认领。
# 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 -- --purgeRemove-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 |
| BusyBox | init 脚本、inittab 行(然后运行 kill -HUP 1)、二进制文件 | /etc/wantastic |
| macOS | LaunchDaemon 和 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).1wantasticd uninstalled.
- 1配置已保留
自动更新的工作方式
- 自动更新默认开启。守护进程在启动 1 分钟后检查新版本,之后每小时检查一次。
- 它只安装更新的版本,绝不降级。
- 它会将旧的二进制文件保留为 .previous,重启服务并检查其是否正常。如果不正常,则恢复旧的二进制文件。
- 失败会被记录,并在下一次每小时检查时重试。
关闭自动更新
在服务运行的命令中添加 --no-auto-update。
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 的形式保留在当前文件旁边。
sudo systemctl stop wantasticd
sudo mv /usr/local/bin/wantasticd.previous /usr/local/bin/wantasticd
sudo systemctl start wantasticd警告: 自动更新会在一小时内再次将你升级到新版本。如需停留在旧版本,请关闭自动更新(见上文),并告知支持团队哪个版本出现了问题。
验证结果
常见问题
更新失败,旧版本继续运行。Self-update failed; agent remains active and will retry on the next scheduled check: …服务日志
下载、校验或重启失败。代理继续以当前版本运行。
查看更新日志,解决问题原因(网络、磁盘空间),然后再次更新。
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>" 也是同一问题)。
释放一些空间,然后再次更新。
df -h
sudo wantasticd update更新超时。update attempt timed out after 7m0s (log kept at /tmp/wantasticd-update-XXXX.log)服务日志
链路非常慢,或服务重启卡住了。
在链路状况较好时手动运行更新。对于慢速链路,请调高 WANTASTIC_UPDATE_DOWNLOAD_TIMEOUT。
sudo wantasticd update自行构建的二进制文件拒绝更新。Invalid update version: parse current version: version "dev" is not major.minor.patchwantasticd update
本地构建的版本显示为 dev。
使用安装程序安装官方发布版本。
curl -fsSL https://get.wantastic.app/install.sh | sudo shWindows 更新已回滚。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 和事件查看器,或重启电脑。然后再次运行卸载命令。
继续阅读
仍然无法解决?
请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。