Qwen Code Atomic-Swap Upgrade
Qwen Code at /root is a release tarball install at /root/.local/lib/qwen-code/, NOT npm and NOT a git clone. qwen update refuses with a misleading "git clone" message; npm install -g writes to the wrong path. Manual atomic-swap is the only working upgrade (proven 2026-08-14/18/21).
Procedure
qwen --version— record current OLD version.- Fetch expected hash:
curl -fsSL https://github.com/QwenLM/qwen-code/releases/download/vNEW/SHA256SUMS | grep linux-x64 - Download tarball to /tmp, verify
sha256sumMATCHES. Mismatch → abort, report. mv /root/.local/lib/qwen-code /root/.local/lib/qwen-code.old.OLD(preserve active — F1 reversibility)tar -xzf /tmp/qwen-code-NEW.tar.gz -C /root/.local/ && mv /root/.local/qwen-code /root/.local/lib/qwen-code- Write
/root/.local/lib/qwen-code/.qwen-rollback-info.jsonwith preservedVersion / updatedTo / timestamp / reason / rollback command. - Verify
qwen --version→ NEW. Clean tarball. settings.jsonis never touched — yolo/empty-deny + provider entries survive (config is version-agnostic).
Rollback
mv /root/.local/lib/qwen-code.old.OLD /root/.local/lib/qwen-code. The running session keeps the old binary in memory; next launch gets the new one. Never delete the .old tree same-day.