bin/mirrors-update

18 lines
587 B
Bash
Executable File

#!/bin/sh
echo "Downloading mirrorlist"
curl -o ~/Temp/mirrorlist.txt https://www.archlinux.org/mirrorlist/?country=FR&country=DE&country=GB&protocol=http&protocol=https&ip_version=4&use_mirror_status=on
sed -i 's/#S/S/g' ~/Temp/mirrorlist.txt
echo "Ranking mirrorlist"
rankmirrors ~/Temp/mirrorlist.txt > ~/Temp/mirrorlist-fastest.txt
echo "Backing up existing mirrorlist"
sudo mv -v /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.old
echo "Setting new mirrorlist"
sudo mv -v ~/Temp/mirrorlist-fastest.txt /etc/pacman.d/mirrorlist
echo "Updating repositories"
sudo pacman -Syyu