We’ve all faced this problem sometime or the other : Installing/upgrading packages takes forever because the pacman mirrors are slow.
Thankfully, as always, the Arch wiki and pacman have us covered. Pacman itself comes with a bash script which is at
. This script ranks mirrors according to their connection and opening speeds.
First make a backup of your existing mirrorlist.
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
Edit the mirrorlist and uncomment all mirrors for testing.
# sed -i 's/^# Server/Server/' /etc/pacman.d/mirrorlist.backup
Finally rank the mirrors. The ‘6’ below outputs the 6 fastest mirrors.
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
Note that it is good practice now to run the following.
# pacman -Syyu
This forces a redownload of the package lists and upgrades the packages. Passing two
–refresh or -y flags will force a refresh of all package lists even if they appear to be up to date.