Skip to content

fix(mobile): phone setup recovers from a half-deleted install and installs again - #35

Draft
tebiggs wants to merge 4 commits into
mainfrom
t3/fix-phone-server-setup
Draft

tebiggs wants to merge 4 commits into
mainfrom
t3/fix-phone-server-setup

Conversation

@tebiggs

@tebiggs tebiggs commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Phone setup got stuck in two ways.

Half-deleted install looked installed. Remove and Reinstall deleted the runtime folder in place. When that delete stopped partway, the setup.done and ubuntu.installed markers survived next to an Ubuntu missing /usr/bin/env. Setup then showed step 1 as done, and every proot call failed ('/usr/bin/env' not found) until app data was cleared.

  • Remove moves the folder into device-runtime.trash before deleting it, so an interrupted delete only leaves storage behind. The next remove or install retries it.
  • "Installed" also requires the guest's /usr/bin/env to resolve, so a damaged install offers Install again.
  • Guest commands refuse to start on a damaged install with a clear message. The sign-in step no longer shows "Checking…" forever after a failed check.

Fresh installs failed at "Installing Ubuntu packages". dpkg failed with error setting ownership of '/usr/bin/perl5.40.1.dpkg-new': No such file or directory while upgrading perl-base. filesDir is /data/user/0/…, a symlink to /data/data/…. proot resolves --rootfs but takes PROOT_L2S_DIR as given, so its faked hard links pointed at a path the guest can't follow. This has been broken since #17. The runtime now uses the canonical filesDir.

Sharing stuck on "Still stopping" after a reinstall. The saved sharing record named the old phone server, whose connection was forgotten with its Ubuntu, so every retry gave up and nothing could clear it. The phone runs one server, so when another one answers under a new id, the record now moves on to removing the old T3 Connect listing.

Update Claude did nothing on the phone. claude update refuses an apt install ("Claude is managed by a package manager") and exits 0. The version check also used the latest channel while the apt repository follows stable, so the install always looked outdated. A dpkg-owned claude now checks the channel its apt source names. As root (the phone), Update Claude refreshes only Claude's apt list and upgrades the package. Otherwise it shows the sudo apt-get command. This change is in shared server code, so it also affects apt installs on desktop Linux.

I reproduced the dpkg failure on Linux with the same termux/proot tag (v5.1.107.101), an Ubuntu 26.04.1 rootfs extracted the way the app does it, and the rootfs behind a symlink. With the fix, the packages step completes and perl5.40.1 runs. Tim confirmed on the phone that install and connect now work with the CI APK from cf57c2e. I checked the apt update command in the same local Ubuntu; it reaches the phone's server only after a fork release and Update T3 Code.

Made with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

tebiggs and others added 4 commits November 7, 2026 20:57
Remove and Reinstall deleted the runtime folder in place, so a delete that
stopped partway left the "installed" markers beside an Ubuntu missing
/usr/bin/env. The app then showed setup as done and every proot call failed.

Remove now moves the folder aside before deleting it, installed also checks
that the guest's /usr/bin/env resolves, a guest command refuses to start on a
damaged install, and the delete chmods each directory before listing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
proot resolves the rootfs to /data/data/... but took PROOT_L2S_DIR as given,
under the /data/user/0 symlink. Its faked hard links then pointed at a path
the guest can't follow, so dpkg failed upgrading perl-base (error setting
ownership of /usr/bin/perl5.40.1.dpkg-new). Reproduced with the same proot
on Linux by putting the rootfs behind a symlink; resolving filesDir fixes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nstall

A saved "stopping" record named the old phone server, whose connection was
forgotten when Ubuntu was reinstalled. Every retry found no connection and
gave up, so the toggle stayed on "Still stopping" with nothing that could
clear it. The phone runs one server, so when another one answers under a new
id the old tunnel is gone with its Ubuntu: the record moves on to removing
the T3 Connect listing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`claude update` refuses an apt install ("Claude is managed by a package
manager") and exits 0, so Update Claude reported success and still found the
old version. The version check also used the latest channel, while the apt
repository follows stable, so the install always looked outdated.

A claude that dpkg owns now checks the channel its apt source names. As root,
as on the phone, Update Claude refreshes only Claude's apt list and upgrades
the package; otherwise it shows the sudo apt-get command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant