How to sort mirrors by speed

pacman
mirror

(Hans Tovetjärn) #1

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 /etc/pacman.d/mirrorlist:

# 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

The operand -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.


7th gen Intel NUC wireless card (Intel® Wireless-AC 9462) is only supported on Linux 4.14+, when will a 4.14-based kernel be available?
Can't update firefox, and default cursor theme on it
(tom) #2

this step isn’t necessary because our mirrors are not commented like in arch linux


(Hans Tovetjärn) #3

Duly noted, it was changed back in October 2015. I should probably look at the sources rather than my installation.


(Void) #4

There’s a catch. I was given a French mirror as the top one. Probably it has the lowest ping time, but the transfer there is capped at 100KB/s. Therefore the first update after installation has taken me many hours.
I’ve removed that one manually, and the rest of them work like a charm.