From d3496bbd02ab84613135d595f74e027078242955 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Fri, 25 Sep 2026 08:35:54 +0200 Subject: [PATCH] fix: No second sudo password prompt while installing yay makepkg -si installs with sudo -k, which forgets the cached password. Build with makepkg, install with sudo pacman -U. --- CHANGELOG.md | 3 +++ lib/packages.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffdb680..9c9380f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ one per merged pull request. unchanged, when single user mode is off; the single user wallet is kept and reused next time. - Moved from the SteamOS theme, where it only helped without any wallet. +- **fix: No second sudo password prompt while installing yay** + - `makepkg -si` installs with `sudo -k`, which forgets the cached password; + yay is now built with makepkg and installed with `sudo pacman -U`. - **docs: LICENSE.md** with the MIT license the README already named. - **chore: No more `setup-gamescope-boot.sh` release asset** - Only `steamify.sh` is published; the old name from before 0.9.0 is gone. diff --git a/lib/packages.sh b/lib/packages.sh index e1e2ae8..14164d0 100644 --- a/lib/packages.sh +++ b/lib/packages.sh @@ -41,8 +41,13 @@ bootstrap_yay() { return 1 fi + # Build only, then install it ourselves: makepkg -i runs `sudo -k pacman`, + # which forgets the cached sudo password and asks for it again. info "Building and installing yay (this runs makepkg as your user, not root)..." - if (cd "$tmp_dir/yay-bin" && makepkg -si --noconfirm); then + local -a pkgs + if (cd "$tmp_dir/yay-bin" && makepkg --noconfirm) && + mapfile -t pkgs < <(cd "$tmp_dir/yay-bin" && makepkg --packagelist | grep -v -- '-debug-') && + sudo pacman -U --noconfirm "${pkgs[@]}"; then ok "yay installed." rm -rf "$tmp_dir" return 0