2025-07-24 07:38:18 -03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2025-07-26 13:17:13 -03:00
|
|
|
chaotic_ok=0
|
|
|
|
|
2025-07-24 07:38:18 -03:00
|
|
|
# Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages
|
|
|
|
if [[ "$(uname -m)" == "x86_64" ]]; then
|
2025-07-26 13:17:13 -03:00
|
|
|
# Try installing Chaotic-AUR keyring and mirrorlist
|
|
|
|
if sudo pacman-key --recv-key 3056513887B78AEB &&
|
|
|
|
sudo pacman-key --lsign-key 3056513887B78AEB &&
|
|
|
|
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' &&
|
|
|
|
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'; then
|
2025-07-24 07:38:18 -03:00
|
|
|
|
2025-07-26 13:17:13 -03:00
|
|
|
# Add Chaotic-AUR repo to pacman config
|
|
|
|
echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
|
2025-07-24 07:38:18 -03:00
|
|
|
|
2025-07-26 13:17:13 -03:00
|
|
|
# Refresh pacman package databases
|
|
|
|
sudo pacman -Sy
|
2025-07-24 07:38:18 -03:00
|
|
|
|
2025-07-26 13:17:13 -03:00
|
|
|
chaotic_ok=1
|
|
|
|
else
|
|
|
|
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
|
|
|
|
fi
|
|
|
|
fi
|
2025-07-24 07:38:18 -03:00
|
|
|
|
2025-07-26 13:17:13 -03:00
|
|
|
if [[ $chaotic_ok -eq 1 ]]; then
|
2025-07-24 07:38:18 -03:00
|
|
|
sudo pacman -S --needed --noconfirm yay
|
|
|
|
else
|
2025-07-26 13:17:13 -03:00
|
|
|
# Manually install yay from AUR if not already available
|
2025-07-24 07:38:18 -03:00
|
|
|
if ! command -v yay &>/dev/null; then
|
2025-07-26 13:17:13 -03:00
|
|
|
# Install build tools
|
|
|
|
sudo pacman -S --needed --noconfirm base-devel
|
2025-07-24 07:38:18 -03:00
|
|
|
cd /tmp
|
|
|
|
git clone https://aur.archlinux.org/yay-bin.git
|
|
|
|
cd yay-bin
|
|
|
|
makepkg -si --noconfirm
|
|
|
|
cd -
|
|
|
|
rm -rf yay-bin
|
|
|
|
cd ~
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Add fun and color to the pacman installer
|
|
|
|
sudo sed -i '/^\[options\]/a Color\nILoveCandy' /etc/pacman.conf
|