zh-CN:Mirrors Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.
- 1 Enabling a specific mirror
- 2 Mirror status
- 3 Sorting mirrors
- 4 Official mirrors
- 5 Unofficial mirrors
- 6 Troubleshooting
- 7 See Also
Enabling a specific mirror
To enable mirrors, open
/etc/pacman.d/mirrorlist and locate your geographic region. Uncomment mirrors you would like to use.
# Any # Server = ftp://mirrors.kernel.org/archlinux/$repo/os/$arch Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch
It is also possible to specify mirrors in
/etc/pacman.conf. For the [core] repository, the default setup is:
[core] Include = /etc/pacman.d/mirrorlist
To use the HostEurope mirror as a default mirror, add it before the
[core] Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch 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 applicable.
pacman.conf, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from [core] and an older kernel module from [extra].
Force pacman to refresh the package lists
/etc/pacman.d/mirrorlist, (manually or by using
rankmirrors) issue the following command:
# pacman -Syy
-yflags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing
pacman -Syywhenever changing to a new mirror is good practice and will avoid possible issues.
You can generate an up to date mirrorlist here, automate the process with a script, or install Reflector, a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:
- picking a server and browsing to "extra/os/";
- accessing https://www.archlinux.org/ in another browser tab or window; and
- comparing the last-modified date of the
i686directory on the mirror to the [extra] date on the homepage, in the Package Repositories box to the right.
When downloading packages pacman uses the mirrors in the order they are in
/etc/pacman.d/mirrorlist. 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
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script,
Back up the existing
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
/etc/pacman.d/mirrorlist.backup and uncomment mirrors for testing with
Optionally run the following
sed line to uncomment every mirror:
# sed '/^#\S/ s|#||' -i /etc/pacman.d/mirrorlist.backup
Finally, rank the mirrors. Operand
-n 6 means only output the 6 fastest mirrors:
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
rankmirrors -h for a list of all the available options.
Combined listing by speed and status
It is not a good idea to just use the fastest mirrors, since the fastest mirrors 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 mirrors to the top of
/etc/pacman.d/mirrorlist and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends 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 not having mirror problems, to keep
/etc/pacman.d/mirrorlist up to date.
Script to download from Mirrorlist Generator
The following shell script can be used to create a mirror list based on the rankings produced by the Pacman Mirrorlist Generator (the country variable will need to be changed if not living in the United States). It can be downloaded by invoking:
curl http://pastebin.ca/raw/2404700 -o pacmrr, (view script).
Alternatively, you can use Reflector to automatically retrieve the latest mirrorlist from the MirrorStatus page, filter the most up-to-date mirrors, sort them by speed and overwrite the file
Choosing a local mirror
The simple way is to edit the mirrorlist file by placing a local mirror at the top of the list. pacman will then use this mirror for preference.
/etc/pacman.conf can be edited by placing a local mirror before the line sourcing the mirrorlist file, i.e. where it says "add your preferred servers here". It is safer if you use the same server for each repository.
The official Arch Linux mirror list is available from the Pacman Mirror List Generator page on the main site.package. To get an even more up-to-date list of mirrors, use the
In the unlikely scenario that you are without any configured mirrors and
pacman-mirrorlist is not installed, run the following command:
# wget -O /etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/
Be sure to uncomment a preferred mirror as described above, then:
# pacman -Syy # pacman -S --force pacman-mirrorlist
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the #Unofficial mirrors list at the end of this page.
If you get an error stating that the
$arch variable is used but not defined, add the following to your
Architecture = x86_64
The pacman mirror list generator can also be used to find a list of current IPv6 mirrors.
These mirrors are not listed in
- http://sourceforge.net/projects/archlinux/files/ - ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.
- http://gd.tuwien.ac.at/opsys/linux/archlinux/ - Vienna University of Technology
- http://mirrors.zju.edu.cn/archlinux/ - Zhejian University
- http://ftp.sjtu.edu.cn/archlinux/ - Shanghai Jiaotong University
- http://mirrors.ustc.edu.cn/archlinux/ - University of Science and Technology of China
- http://mirrors.tuna.tsinghua.edu.cn/archlinux/ - Tsinghua University
- http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ (ipv4 only)
- http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ (ipv6 only)
- http://mirror.lzu.edu.cn/archlinux/ - Lanzhou University
- http://mirrors.huste.du.cn/archlinux - Huazhong University of Science and Technology
- http://delta.archlinux.fr/ - With Delta package support. Needs xdelta3 package from extra to run.
- http://mirror.kavalinux.com/archlinux/ - only from Indonesia
- http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - NAra Institute of Science and Technology
- ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW
- http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW
- rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW
- http://hatred.homelinux.net/archlinux/ - Vladivostok, without iso, with 3SPY project repos and mingw32 repo
- http://mirrors.krasinfo.ru/archlinux/ - Krasnoyarsk, Classica-Service Ltd
- http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ - Stellenbosch University
- http://ftp.leg.uct.ac.za/pub/linux/arch/ - University of Cape Town
- http://mirror.ufs.ac.za/archlinux/ - University of the Free State
- http://ftp.wa.co.za/pub/archlinux/ - Web Africa Networks
- http://archlinux.mirror.ac.za - TENET - Tertiary Education and Research Network of South Africa
- http://archlinux.linuxfreedom.com - Contains numerous ISO images but does not contain the ISO dated 2011.08.19
Out-of-sync mirrors: corrupted packages/file not found
Issues regarding out-of-sync mirrors pointed out in this news post may have already been sorted out for most users, but in the event that problems of this nature present themselves again, simply try to see if the packages are present in the [testing] repository.
After having synced with
pacman -Sy, use this command:
# pacman -Ud $(pacman -Sup | tail -n +2 | sed -e 's,/\(core\|extra\)/,/testing/,' \ -e 's,/\(community\)/,/\1-testing/,')
Doing so could help in any occasion where packages in the mirror have not been synced to [core] or [extra], and are still residing in [testing]. It is perfectly safe to install from [testing] in this case since the packages are being matched by version and release numbers.
In any event, it is best to switch mirrors and sync with
pacman -Syy than resorting to an alternate repository. However, all or some of the mirrors may at times be out-of-sync to some degree.
Using all mirrors
pacman -Su's behavior of going through the entire mirror list, use this script:
#!/bin/bash # Pacman will not exit on the first error. Comment the line below to # try from [testing] directly. pacman -Su "$@" && exit while read -r pkg; do if pacman -Ud "$pkg"; then continue else while read -r mirror; do pacman -Ud $(sed "s,.*\(/\(community-\)*testing/os/\(i686\|x86_64\)/\),$mirror\1," <<<"$pkg") && break done < <(sed -ne 's,^ *Server *= *\|/$repo/os/\(i686\|x86_64\).*,,gp' \ </etc/pacman.d/mirrorlist | tail -n +2 ) fi done < <(pacman -Sup | tail -n +2 | sed -e 's,/\(core\|extra\)/,/testing/,' \ -e 's,/\(community\)/,/\1-testing/,')
- MirUp – pacman mirrorlist downloader/checker