Files
lnx-arch/scripts/99_yay.sh

31 lines
578 B
Bash
Raw Permalink Normal View History

2024-05-01 16:14:59 -05:00
#!/usr/bin/env bash
# klevstul
2024-05-01 16:18:51 -05:00
# https://itsfoss.com/install-yay-arch-linux/
2024-05-01 16:47:27 -05:00
# https://askubuntu.com/questions/294736/run-a-shell-script-as-another-user-that-has-no-password
2024-05-01 16:18:51 -05:00
2024-05-01 16:14:59 -05:00
echo "<< 99_yay.sh >>"
2024-05-01 16:23:22 -05:00
user=poq
2024-05-01 16:14:59 -05:00
if [ "$EUID" -ne 0 ]
then echo "error: run as 'root'"
exit
fi
2024-05-01 16:32:01 -05:00
# update system
sudo pacman -Syu
2024-05-01 16:47:27 -05:00
# remove potential old yay download folder
2024-05-01 16:20:31 -05:00
rm -rf /tmp/yay
2024-05-01 16:38:22 -05:00
2024-05-01 16:44:17 -05:00
# clone repo
runuser -l ${user} -c 'git clone https://aur.archlinux.org/yay.git /tmp/yay'
# build yay
2024-05-01 16:42:50 -05:00
sudo -u ${user} bash -c 'cd /tmp/yay && makepkg -si'
2024-05-01 16:40:21 -05:00
2024-05-01 16:32:01 -05:00
# test yay
2024-05-01 16:23:22 -05:00
runuser -l ${user} -c 'yay --version'