Files
lnx-arch/scripts/99_yay.sh
tuxwarrior 62307b67aa u
2024-05-01 16:42:50 -05:00

34 lines
634 B
Bash

#!/usr/bin/env bash
# klevstul
# https://itsfoss.com/install-yay-arch-linux/
echo "<< 99_yay.sh >>"
user=poq
if [ "$EUID" -ne 0 ]
then echo "error: run as 'root'"
exit
fi
# update system
sudo pacman -Syu
# install dependencies
pacman -S --needed --noconfirm go
# install yay
rm -rf /tmp/yay
runuser -l ${user}-c 'git clone https://aur.archlinux.org/yay.git /tmp/yay'
# https://askubuntu.com/questions/294736/run-a-shell-script-as-another-user-that-has-no-password
sudo -u ${user} bash -c 'cd /tmp/yay && makepkg -si'
#runuser -l ${user} -c 'cd /tmp/yay && makepkg -si'
# test yay
runuser -l ${user} -c 'yay --version'