From 0cfe10e3878a0f8965f73285b48031f0643db143 Mon Sep 17 00:00:00 2001 From: mk Date: Tue, 28 Jul 2026 07:08:04 +0300 Subject: [PATCH] =?UTF-8?q?packages(debian):=20fix=20eza+starship+zoxide?= =?UTF-8?q?=20installs=20-=20eza:=20apt.fury.io=20PPA=20is=20dead=20(401?= =?UTF-8?q?=20Unauthorized);=20install=20the=20single=20binary=20from=20th?= =?UTF-8?q?e=20upstream=20GitHub=20release=20tarball=20(eza=5Fx86=5F64-unk?= =?UTF-8?q?nown-linux-gnu.tar.gz)=20into=20/usr/local/bin=20=E2=80=94=20no?= =?UTF-8?q?=20apt=20repo,=20system-wide=20-=20starship:=20scrub=20$ARCH/$P?= =?UTF-8?q?LATFORM=20from=20the=20installer=20env=20=E2=80=94=20our=20lib/?= =?UTF-8?q?detect.sh=20exports=20ARCH=3Damd64,=20which=20the=20starship=20?= =?UTF-8?q?installer=20reuses=20(it=20checks=20${ARCH-})=20and=20skips=20i?= =?UTF-8?q?ts=20own=20amd64->x86=5F64=20mapping,=20producing=20an=20unsupp?= =?UTF-8?q?orted=20'amd64-unknown-linux-musl'=20target.=20Default=20bin=20?= =?UTF-8?q?dir=20is=20/usr/local/bin=20anyway=20-=20zoxide:=20install=20sy?= =?UTF-8?q?stem-wide=20(--bin-dir=20/usr/local/bin)=20instead=20of=20~/.lo?= =?UTF-8?q?cal/bin=20=E2=80=94=20when=20run=20as=20root=20the=20default=20?= =?UTF-8?q?landed=20in=20/root=20(wrong=20user=20for=20the=20create-user?= =?UTF-8?q?=20path)=20and=20wasn't=20on=20$PATH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/10-packages.sh | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/modules/10-packages.sh b/modules/10-packages.sh index 6ef2cda..ea93af2 100755 --- a/modules/10-packages.sh +++ b/modules/10-packages.sh @@ -78,24 +78,42 @@ _pkg_debian() { # rename packages: fd -> fdfind, bat -> batcat (fix via aliases in zsh) sudo_ apt-get install -y fdfind batcat 2>/dev/null || true - # eza via the gierens PPA (debs not in base apt) + # eza: the old apt.fury.io/gierens PPA is dead (401 Unauthorized). Install the + # single binary from the upstream GitHub release tarball into /usr/local/bin + # (system-wide — works for root and every sudo user; no HOME dependency). if ! command -v eza >/dev/null 2>&1; then - sudo_ install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://raw.githubusercontent.com/eza-community/eza/main/deb.asc \ - | sudo_ tee /etc/apt/keyrings/gierens.gpg >/dev/null - echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://apt.fury.io/eza/ /" \ - | sudo_ tee /etc/apt/sources.list.d/eza.list >/dev/null - sudo_ apt-get update -y && sudo_ apt-get install -y eza || warn "eza PPA failed" + local eza_arch; case "$ARCH" in + amd64) eza_arch=x86_64-unknown-linux-gnu ;; + arm64) eza_arch=aarch64-unknown-linux-gnu ;; + *) eza_arch="${ARCH}-unknown-linux-gnu" ;; + esac + local url="https://github.com/eza-community/eza/releases/latest/download/eza_${eza_arch}.tar.gz" + local tmp; tmp="$(mktemp -d)" + if wget -qO "$tmp/eza.tgz" "$url" && tar xzf "$tmp/eza.tgz" -C "$tmp"; then + sudo_ install -m 0755 "$tmp/eza" /usr/local/bin/eza + else + warn "eza download failed ($url)" + fi + rm -rf "$tmp" fi - # starship: official installer + # starship: official installer. NOTE — scrub $ARCH/$PLATFORM from the env first: + # the installer reuses a pre-set ARCH (our lib/detect.sh exports ARCH=amd64) and + # skips its own amd64->x86_64 mapping, yielding an unsupported 'amd64-unknown-linux- + # musl' target ('builds for amd64-unknown-linux-musl are not yet available'). + # Default bin dir is /usr/local/bin (system-wide). if ! command -v starship >/dev/null 2>&1; then - curl -sS https://starship.rs/install.sh | sh -s -- -y || warn "starship install failed" + curl -sS https://starship.rs/install.sh \ + | env -u ARCH -u PLATFORM sh -s -- -y || warn "starship install failed" fi - # zoxide: official installer + # zoxide: official installer. Install system-wide (/usr/local/bin) instead of the + # default ~/.local/bin — when run as root the default lands in /root (wrong user + # for the create-user path) and isn't on $PATH; /usr/local/bin is on PATH for all. if ! command -v zoxide >/dev/null 2>&1; then - curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash || warn "zoxide install failed" + curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh \ + | env -u ARCH sh -s -- --bin-dir /usr/local/bin --man-dir /usr/local/share/man \ + || warn "zoxide install failed" fi # yq: direct binary from mikefarah/yq releases (stable URL)