Fix Starship install failure: install to ~/.local/bin to avoid root escalation#1
Open
fan759 wants to merge 1 commit into
Open
Fix Starship install failure: install to ~/.local/bin to avoid root escalation#1fan759 wants to merge 1 commit into
fan759 wants to merge 1 commit into
Conversation
The upstream installer defaulted to /usr/local/bin, which forced a re-run under sudo. The root-context download was failing (curl --fail hitting an HTTP error, e.g. when sudo strips proxy env vars), while the same download works fine as the normal user. Passing --bin-dir $HOME/.local/bin keeps the install entirely in user space -- that dir is already created for the bat symlink and is first on PATH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
setup_ubuntu.shstep3/8 Starshipfails to install:The upstream message ("This is likely due to Starship not yet supporting your configuration") is a red herring —
x86_64-unknown-linux-muslis supported (current latestv1.25.1ships that asset), and the tarball downloads fine as a normal user. That text is just the installer's generic fallback for any download failure.Root cause
The upstream installer defaults its bin dir to
/usr/local/bin, which isn't user-writable, so it re-runs the download undersudo(Installing Starship as root…). curl exit code22=--failsaw an HTTP status ≥ 400 during that root-context download. Common causes:sudostrips proxy env vars (env_reset), so a corporate proxy is bypassed and the request gets a 4xx; or a transient GitHub rate-limit. The identical download succeeds as the normal user.Fix
Pass
--bin-dir "$HOME/.local/bin"to the installer so the install stays entirely in user space and never escalates to root — eliminating the failing step. That directory is already created (for thebatsymlink) and is first onPATH, so it matches the script's existing conventions.macOS uses
brew install starship, so it is unaffected.