myconf_artix/inst/scripts/repo-enable.sh

54 lines
2.0 KiB
Bash
Raw Normal View History

2022-03-26 05:52:48 +00:00
#!/bin/sh
if [ -z "$(grep "^\[lib32" /etc/pacman.conf)" ]; then
echo "lib32 not enabled. Appending lines to /etc/pacman.conf"
sleep 1
sudo sh -c 'echo "[lib32]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
sudo pacman -Syu
if [ -z "$(grep "community" /etc/pacman.conf)" ]; then
#add arch linux repos
sudo pacman -S --noconfirm artix-archlinux-support lib32-artix-archlinux-support
sudo pacman-key --populate archlinux
sudo pacman -Sy
sudo sh -c 'echo "[community]" >> /etc/pacman.conf'
sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
#if [ -z "$(grep "extra" /etc/pacman.conf)" ]; then
# sudo sh -c 'echo "[extra]" >> /etc/pacman.conf'
# sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
# sudo sh -c 'echo "" >> /etc/pacman.conf'
#fi
#
#if [ -z "$(grep "multilib" /etc/pacman.conf)" ]; then
# sudo sh -c 'echo "[multilib]" >> /etc/pacman.conf'
# sudo sh -c 'echo "Include = /etc/pacman.d/mirrorlist-arch" >> /etc/pacman.conf'
#fi
if [ -z "$(grep "universe" /etc/pacman.conf)" ]; then
sudo sh -c 'echo "[universe]" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://universe.artixlinux.org/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror1.artixlinux.org/universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror.pascalpuffke.de/artix-universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://artixlinux.qontinuum.space:4443/universe/os/" >> /etc/pacman.conf'
sudo sh -c 'echo "Server = https://mirror1.cl.netactuate.com/artix/universe/\$arch" >> /etc/pacman.conf'
sudo sh -c 'echo "" >> /etc/pacman.conf'
fi
sudo pacman -Syu
#install yay for aur support
mkdir -p ~/.local/src/
git clone https://aur.archlinux.org/yay.git ~/.local/src/yay/
cd ~/.local/src/yay || return
makepkg -si