From 90ed3322b5ab2b0109897a93f3c97209b156f2c2 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Mon, 1 Jun 2026 15:13:04 +0200 Subject: [PATCH] Install Starship into ~/.local/bin to avoid root escalation 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. --- setup_ubuntu.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index 72b2a8e..ef749b4 100755 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -28,7 +28,11 @@ echo "── 3/8 Starship (prompt) ────────────── if command -v starship &>/dev/null; then echo "✓ Already installed ($(starship --version 2>&1 | head -1))" else - curl -sS https://starship.rs/install.sh | sh -s -- --yes + # Install to ~/.local/bin (already on PATH) so the upstream installer does + # not escalate to root for /usr/local/bin -- the root-context download was + # failing (sudo strips proxy env vars; curl --fail then sees an HTTP error). + mkdir -p ~/.local/bin + curl -sS https://starship.rs/install.sh | sh -s -- --yes --bin-dir "$HOME/.local/bin" echo "✓ Starship installed" fi