Skip to content

Instantly share code, notes, and snippets.

@hlissner
Created April 3, 2019 05:46
Show Gist options
  • Save hlissner/9ec4d02e809f41911b057f8655776edc to your computer and use it in GitHub Desktop.
Save hlissner/9ec4d02e809f41911b057f8655776edc to your computer and use it in GitHub Desktop.
Install yay on Arch Linux
if ! command -v yay >/dev/null; then
tmp=$(mktemp -d)
function finish { rm -rf "$tmp"; } # clean up after yourself...
trap finish EXIT # ...no matter how you exist
git clone https://aur.archlinux.org/yay.git "$tmp"
pushd "$tmp"
makepkg -sri --noconfirm --needed
popd
if ! command -v yay >/dev/null; then
>&2 echo "yay failed to install"
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment