From ArchWiki
Jump to navigation Jump to search


Official mirrors



If you want your mirror to be added to the official list, see DeveloperWiki:NewMirrors. In the meantime, add it to the Unofficial mirrors article.

IPv6-ready mirrors


Enabling a specific mirror



# Any
Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch

See #Sorting mirrors for tools that help choosing mirrors.



Include = /etc/pacman.d/mirrorlist


Server = http://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch
Include = /etc/pacman.d/mirrorlist



Force pacman to refresh the package lists



# pacman -Syyu

Passing two --refresh/-y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syyu is an unnecessary waste of bandwidth in most cases, but can sometimes fix issues when switching from a broken mirror to a working mirror. See also Is -Syy safe?.

Warning: In most cases if you force refresh the pacman database, you will want to force downgrade any potentially too-new packages to correspond to the versions offered by the new mirror. This prevents issues where packages are inconsistently upgraded, leading to a partial update.
# pacman -Syyuu

This is not necessary when using timestamps to ensure the mirrors are only upgraded.

Sorting mirrors

When downloading packages, pacman uses the mirrors in the order they are listed in /etc/pacman.d/mirrorlist. The order servers appear in the list sets their priority.

It is not optimal to only rank mirrors based on speed since the fastest servers might be out-of-sync. Instead, make a list of mirrors sorted by their speed, then remove those from the list that are out of sync according to their status.

It is recommended to repeat this process before every system upgrade to keep the list of mirrors up-to-date.

List by speed

Ranking an existing mirror list


Back up the existing /etc/pacman.d/mirrorlist:


To prepare mirrorlist.backup for ranking with rankmirrors, the following actions can be carried out:

  • Edit mirrorlist.backup and uncomment the servers to be tested
  • If the servers in the file are grouped by country, one can extract all the servers of a specific country by using:
  • To uncomment every mirror, run the following sed line:

Finally, rank the mirrors, here with the operand -n 6 to only output the 6 fastest mirrors:


Fetching and ranking a live mirror list

In order to start with a shortlist of up-to-date mirrors based in some countries and feed it to rankmirrors one can fetch the list from the Pacman Mirrorlist Generator. The command below pulls the up-to-date mirrors in either France or the United Kingdom which support the https protocol, it uncomments the servers in the list and then ranks them and outputs the 5 fastest.

$ curl -s "https://www.archlinux.org/mirrorlist/?country=FR&country=GB&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 -
Tip: This procedure can be done interactively by navigating to https://www.archlinux.org/mirrorlist with any text-based browser, for example elinks(1).

Server-side ranking


Another popular alternative is the following tool:

Reflector — Retrieves the latest mirrorlist from the MirrorStatus page, filters and sorts them by speed and overwrites /etc/pacman.d/mirrorlist






# pacman -Syu pacman-mirrorlist

See also