When downloading packages pacman uses the mirrors in the order they are in
/etc/pacman.d/mirrorlist. To set a priority to mirrors, the mirrorlist file has to be sorted manually, or using a script. The core/pacman package provides a Bash script,
/usr/bin/rankmirrors, which can be used to rank the mirrors according to their connection and opening speeds to take advantage of using the fastest local mirror.
First create a backup copy of the existing
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
Then rank the mirrors and overwrite the original file with the result:
# rankmirrors -n 4 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
-n 4 means that only the four (4) fastest mirrors are included in the output. Run
rankmirrors -h for a list of all the available options. Also see the mirror status web page to get the status of all known, public, and active Chakra mirrors.