Mirrors

From ArchWiki

Jump to: navigation, search
Article summary
Updating and managing package mirrors
Language
English
简体中文
Related
pacman
reflector

Contents

Enabling an specific mirror

Uncomment the mirror in question at /etc/pacman.d/mirrorlist:

# Any
# Server = ftp://mirrors.kernel.org/archlinux/$repo/os/i686
  Server = http://mirrors.kernel.org/archlinux/$repo/os/i686

Or specify it in /etc/pacman.conf. For the [core] repository, the default setup is:

[core]
Include = /etc/pacman.d/mirrorlist

If wanting to use the HostEurope mirror as a default mirror, add it before the Include line:

[core]
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/i686
Include = /etc/pacman.d/mirrorlist

Pacman will now try to connect to this mirror first. Proceed to do the same for [testing], [extra], and [community], if desired.

Considerations

  • Use the same mirror for all repositories. Otherwise packages may get installed that are incompatible to each other, like kernel26 from core and an older kernel module from extra.
  • The release of pacman 3.1 introduced the /etc/pacman.d/mirrorlist with the variable $repo; no need to maintain separate lists for each repository.

Mirror status

You can check the status of the Arch mirrors and how up to date they are by visiting: Mirrorcheck and/or Mirror status.

Optionally install reflector, an utility that generates a mirrorlist using Mirrorcheck's list. To do so, use yaourt or another AUR helper:

$ yaourt -S reflector

Or manually check how up-to-date a mirror is by:

  1. picking a server and browsing to "extra/os/";
  2. accesing http://www.archlinux.org/ in another browser tab or window; and
  3. comparing the last-modified date of the i686 directory on the mirror to the [extra] date on the homepage, in the Package Repositories box to the right.
Note: Many sites also provide HTTP service, but keep in mind that pacman relies on FTP to determine if a repository is updated. With HTTP it fetches the repository database each time you run pacman -Sy, even if it didn't change since the last run.

Sorting mirrors

If not using reflector, which has the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.

List by speed

Don't forget to take full advantage of using the local fastest mirror, which can be determined via the included python script, /usr/bin/rankmirrors. Taking this in mind, use pacman to install python if not already present:

# pacman -S python 

Use cd to switch to the /etc/pacman.d directory:

# cd /etc/pacman.d

Backup the existing /etc/pacman.d/mirrorlist:

# cp mirrorlist mirrorlist.backup

Edit mirrorlist.backup and uncomment mirrors for testing with rankmirrors:

# nano mirrorlist.backup

Optionally run the following sed line to uncomment every mirror:

# sed '/^#\S/ s|#||' -i mirrorlist.backup

Finally, rank the mirrors. Operand -n 6 means only output the 6 fastest mirrors:

# rankmirrors -n 6 mirrorlist.backup > mirrorlist

Force pacman to refresh the package lists
After creating/editing /etc/pacman.d/mirrorlist, (manually or by using rankmirrors) issue the following command:

# pacman -Syy
Tip: Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy whenever changing to a new mirror is good practice and will avoid possible issues.

Combined listing by speed and status

It is not a good idea to just use the fastest mirror(s), since the fastest mirror(s) might be out of date. The preferred way would be to use #List by speed, then sorting those 6 fastest mirrors by their #Mirror status.

Simply visit either one or both #Mirror status links and sort them by the ones that are more up to date. Move the more up to date mirror(s) to the top of /etc/pacman.d/mirrorlist and if the mirror(s) are way out of date simply don't use those; repeat the process leaving out the outdated mirror(s). So you end up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.

When having mirror issues the above should be repeated. Or repeat once in a while even if you don't have mirror issues, too keep /etc/pacman.d/mirrorlist up to date.

Official mirrors

Attention: Do not add new mirrors to the list below. If you want your mirror to be added to official list, file a feature request and wait for approval before listing it here. In the meantime add it to the #Unofficial mirrors list at the end of this page.

Global

Australia

Austria

Belgium

Brazil

Bulgaria

Canada

Chile

China

Czech Republic

Denmark

Estonia

Finland

France

Germany

Great Britain

Greece

Hungary

India

Indonesia

Ireland

Israel

Italy

Japan

Kazakhstan

Latvia

Lithuania

Netherlands

New Caledonia

Norway

Poland

Portugal

Romania

Russia

Spain

Sweden

Switzerland

Taiwan

Turkey

Ukraine

United States

Vietnam

Unofficial mirrors

These mirrors are not listed in /etc/pacman.d/mirrorlist.

Global

Australia

Bulgaria

China

Germany

Great Britain

Malaysia

New Zealand

Norway

Poland

South Africa

Spain

United States

IPv6-ready mirrors

Personal tools