fix chaotic aur installation

This commit is contained in:
Saull Brandão
2025-07-26 13:17:13 -03:00
parent 51e2fa8598
commit 4e4e82c5b9
2 changed files with 32 additions and 27 deletions

View File

@ -1,27 +1,34 @@
#!/bin/bash #!/bin/bash
chaotic_ok=0
# Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages # Only add Chaotic-AUR if the architecture is x86_64 so ARM users can build the packages
if [[ "$(uname -m)" == "x86_64" ]]; then if [[ "$(uname -m)" == "x86_64" ]]; then
# Import Chaotic-AUR key # Try installing Chaotic-AUR keyring and mirrorlist
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com if sudo pacman-key --recv-key 3056513887B78AEB &&
sudo pacman-key --lsign-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
# Install Chaotic-AUR keyring and mirrorlist # Add Chaotic-AUR repo to pacman config
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
# Add Chaotic-AUR repo to pacman config # Refresh pacman package databases
echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null sudo pacman -Sy
# Refresh pacman package databases chaotic_ok=1
sudo pacman -Sy else
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
fi
fi
# Install yay if [[ $chaotic_ok -eq 1 ]]; then
sudo pacman -S --needed --noconfirm yay sudo pacman -S --needed --noconfirm yay
else else
sudo pacman -S --needed --noconfirm base-devel # Manually install yay from AUR if not already available
if ! command -v yay &>/dev/null; then if ! command -v yay &>/dev/null; then
# Install build tools
sudo pacman -S --needed --noconfirm base-devel
cd /tmp cd /tmp
git clone https://aur.archlinux.org/yay-bin.git git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin cd yay-bin
@ -30,7 +37,6 @@ else
rm -rf yay-bin rm -rf yay-bin
cd ~ cd ~
fi fi
fi fi
# Add fun and color to the pacman installer # Add fun and color to the pacman installer

View File

@ -1,21 +1,20 @@
echo "Add Chaotic-AUR to get compiled binaries" echo "Add Chaotic-AUR to get compiled binaries"
if [[ "$(uname -m)" == "x86_64" ]] && ! grep -q '^\[chaotic-aur\]' /etc/pacman.conf; then if [[ "$(uname -m)" == "x86_64" ]] && ! grep -q '^\[chaotic-aur\]' /etc/pacman.conf; then
# Import Chaotic-AUR key # Try installing Chaotic-AUR keyring and mirrorlist
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com if sudo pacman-key --recv-key 3056513887B78AEB &&
sudo pacman-key --lsign-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
# Install Chaotic-AUR keyring and mirrorlist
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'
if [[ -f /etc/pacman.d/chaotic-mirrorlist ]]; then
# Add Chaotic-AUR repo to pacman config # 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 echo -e '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf >/dev/null
else
echo "Failed to download chaotic-mirrorlist, so won't include it in pacman config!"
fi
# Refresh pacman package databases # Refresh pacman package databases
sudo pacman -Sy sudo pacman -Sy
chaotic_ok=1
else
echo "Failed to install Chaotic-AUR, so won't include it in pacman config!"
fi
fi fi