https://wiki.archlinux.org/api.php?action=feedcontributions&user=Yaoge123&feedformat=atomArchWiki - User contributions [en]2024-03-28T13:07:37ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Mirrors_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=479775Mirrors (简体中文)2017-06-14T08:02:33Z<p>Yaoge123: Add Nanjing Univ. Mirror</p>
<hr />
<div>[[Category:About Arch (简体中文)]]<br />
[[Category:Package management (简体中文)]]<br />
[[ar:Mirrors]]<br />
[[en:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
{{Related articles start (简体中文)}}<br />
{{Related|Mirroring}}<br />
{{Related2|Pacman (简体中文)|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
本页面说明如何选择和配置镜像,以及列出可用的镜像。<br />
<br />
== 启用您喜爱的镜像 ==<br />
<br />
想要启用镜像,打开 {{ic|/etc/pacman.d/mirrorlist}} 并定位到你的地理区域。对您想使用的镜像取消注释。例如:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
参见 [[#镜像状态]] 和 [[#按速度排序]] 查看帮助选择镜像的工具。<br />
<br />
{{小贴士|<br />
* 取消5个你最喜欢的镜像的注释,把他们放在 mirrorlist 文件最上方。这样你就很容易找到它们并且如果第一个镜像出问题可以很容易切换。这也让合并 mirrorlist 更新更容易。<br />
* HTTP 镜像比 FTP 快,因为 HTTP 可以 [[Wikipedia:HTTP persistent connection|保持连接]],而使用 FTP 时 ''pacman''每下载一个新软件包就需要重新建立连接。 <br />
}}<br />
<br />
也可以在 {{ic|/etc/pacman.conf}} 中指定镜像。对于 ''[core]'' 仓库,默认设置是:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
想要使用 ''HostEurope'' 镜像作为默认镜像,把它添加在 {{Ic|Include}} 行之前:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman 会首先尝试链接这个镜像。如果需要的话,可以继续修改''[testing]'', ''[extra]'', 和 ''[community]''部分。<br />
<br />
{{注意|如果镜像直接在 {{ic|pacman.conf}} 中声明,记得在所有的仓库使用同样的镜像。否则不相容的包就可能被安装。如 ''[core]'' 中的 linux 和 ''[extra]'' 中的旧的内核模块不相容。}}<br />
<br />
=== 强制 pacman 刷新软件包列表 ===<br />
<br />
创建和编辑 {{ic|/etc/pacman.d/mirrorlist}} 之后,使用下面命令刷新镜像:<br />
<br />
# pacman -Syyu<br />
<br />
传入两次{{Ic|--refresh}}或{{Ic|-y}}将强制更新所有软件包列表,即使系统认为它们已经是最新。'''每次修改镜像之后都应该使用{{Ic|pacman -Syy}}'''。<br />
<br />
==镜像状态==<br />
可以通过访问如下网址检查镜像的状态:https://www.archlinux.org/mirrors/status/<br />
<br />
从[https://www.archlinux.org/mirrorlist/ 这里]可以自动生成最新的镜像列表,安装[[Reflector]]这个工具也可以自动检查和生成镜像列表。<br />
<br />
==镜像排序==<br />
===按速度排序===<br />
更快的源可以显著的提升pacman的性能,和arch的整体操作体验。可以使用 {{ic|rankmirrors}} 将镜像列表按速度排列。但是{{ic|rankmirrors}}不能测试这些源的速度。<br />
<br />
{{ic|cd}}到{{ic|/etc/pacman.d/}}目录:<br />
{{bc|# cd /etc/pacman.d}}<br />
<br />
备份已经存在的{{ic|/etc/pacman.d/mirrorlist}}:<br />
{{bc|# cp mirrorlist mirrorlist.backup}}<br />
<br />
编辑{{ic|/etc/pacman.d/mirrorlist.backup}},取消要测速镜像前的注释。<br />
<br />
让rankmirrors带上参数{{ic|-n}}对这个备份文件{{ic|mirrorlist.backup}}执行操作,然后把输出重定向以方便生成一个新的/etc/pacman.d/mirrorlist源列表:<br />
{{bc|# rankmirrors -n 6 mirrorlist.backup > mirrorlist}}<br />
{{注意|'''-n 6''':将生成6个最接近的源,运行{{Ic|rankmirrors -h}}可查看所有可用选项。}}<br />
<br />
===按速度和状态排序===<br />
仅是使用最快的镜像服务器并不是一件好事,因为它们可能是过时的。我们更推荐先[[#按速度排序]],然后在选出的镜像中按[[#镜像状态]]排序。<br />
<br />
只要简单地访问它们的[[#镜像状态]]连接,然后将它们按照尽量新的顺序排序。将越新的镜像排到{{ic|/etc/pacman.d/mirrorlist}}的越上面。如果镜像真的太过时了,别用它们(把它们注释掉,然后再[[#按速度排序]]),重复这么做,排除过时的镜像。最后将有6个又快又新的镜像。<br />
<br />
当出现镜像问题是,应该重复上面的步骤。或者一段时间就重复一次以保持{{ic|/etc/pacman.d/mirrorlist}}最新,即使没有镜像问题。<br />
<br />
===使用 Reflector===<br />
<br />
[[Reflector]]工具可以从[https://www.archlinux.org/mirrors/status/ 镜像状态]页面自动获取最新的镜像列表,过滤掉未及时同步的镜像,然后按照速度排序覆盖{{ic|/etc/pacman.d/mirrorlist}}。<br />
<br />
==官方镜像==<br />
官方镜像可以通过软件包 {{pkg|pacman-mirrorlist}} 获得。最新的镜像可以通过[https://www.archlinux.org/mirrorlist/ Pacman 镜像列表生成器]查询。<br />
<br />
如果没有配置任何镜像,也没有安装 {{Ic|pacman-mirrorlist}},请运行如下命令:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
取消选中镜像前的注释然后:<br />
# pacman -Syy<br />
# pacman -S --force pacman-mirrorlist<br />
<br />
如果要将自己的镜像加入官方列表,请提出申请并将其加入下面的 [[#非官方镜像]] 列表。<br />
<br />
如果碰到 {{ic|$arch}} 变量未定义的问题,请在 {{ic|/etc/pacman.conf}} 中加入:<br />
Architecture = auto<br />
<br />
=== 支持 IPv6 的镜像 ===<br />
[https://www.archlinux.org/mirrorlist/?country=all&protocol=http&ip_version=6 pacman 镜像列表生成工具] 可以用来查找当前的 IPv6 镜像。<br />
<br />
==非官方镜像==<br />
镜像'''没有'''加入{{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
===全球===<br />
* http://sourceforge.net/projects/archlinux/files/ - ''Does not have recent ISO releases. Use it only if for getting older ISOs.''<br />
<br />
===保加利亚===<br />
*http://mirror.telepoint.bg/archlinux/ <br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
===中国===<br />
<br />
'''电信'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''北京理工大学''<br />
*http://mirrors.aliyun.com/archlinux/ - ''阿里巴巴''<br />
<br />
'''联通'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''教育网'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''上海交通大学y''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''兰州大学''<br />
*https://mirrors.nju.edu.cn/archlinux/ - ''南京大学''<br />
<br />
===德国===<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
<br />
===印度尼西亚===<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
===立陶宛===<br />
*http://edacval.homelinux.org/mirrors/archlinux/ - ''Only from LT, without ISO''<br />
<br />
===马来西亚===<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
===新西兰===<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
===俄罗斯===<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
<br />
===南非===<br />
*http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ - ''Stellenbosch University''<br />
*ftp://ftp.sun.ac.za/pub/mirrors/archlinux/<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
<br />
===美国===<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.pointysoftware.net/archlinux/<br />
<br />
== 参见 ==<br />
* [http://wiki.gotux.net/code:bash:mirup MirUp] -- pacman mirrorlist downloader/checker</div>Yaoge123https://wiki.archlinux.org/index.php?title=Mirrors&diff=479774Mirrors2017-06-14T08:01:21Z<p>Yaoge123: '</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-hans:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] page on the main site.<br />
<br />
Check the status of the Arch mirrors by visiting the [https://www.archlinux.org/mirrors/status/ Mirror Status] page. It is recommended to only use mirrors that are up to date, i.e. not out of sync.<br />
<br />
If you want your mirror to be added to the official list, see [[DeveloperWiki:NewMirrors]]. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP due to [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, a new connection to server has to be established each time ''pacman'' requests a package to be downloaded, which results in a brief pause.<br />
}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|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]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, issue the following command:<br />
# pacman -Syyu<br />
<br />
Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues. See also [https://bbs.archlinux.org/viewtopic.php?id=163124 Is -Syy safe?].<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. To set a priority to mirrors, the mirrorlist file has to be sorted manually or using a script.<br />
<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of sync. Instead, make a list of mirrors sorted by their [[#List by speed|speed]], then remove those from the list that are out of sync according to their [https://www.archlinux.org/mirrors/status/ status].<br />
<br />
It is recommended to repeat this process before every system upgrade to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== List by speed ===<br />
<br />
{{Remove|1=''rankmirrors'' will be removed from {{Pkg|pacman}} in the next release.[https://git.archlinux.org/pacman.git/commit/contrib/rankmirrors.sh.in?id=0c99eabd50752310f42ec808c8734a338122ec86]}}<br />
<br />
The {{Pkg|pacman}} package provides a Bash script, {{ic|/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.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
=== Server-side ranking ===<br />
<br />
The official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] provides an easy way to obtain a ranked list of mirrors. Because all ranking is done on a single server that takes multiple factors into account, the amount of load on the mirrors and the clients is significantly lower compared to ranking on each individual client.<br />
<br />
There are multiple scripts automating the update of the mirrorlist from the ranking server:<br />
<br />
* [[Reflector]] retrieves the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filters the most up-to-date mirrors, sorts them by speed and overwrites the {{ic|/etc/pacman.d/mirrorlist}} file.<br />
* [https://github.com/Gen2ly/armrr armrr] downloads a ranked mirrorlist for a specific country from the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] and creates a backup of the previous mirrorlist.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
==== Once during installation from live medium ====<br />
The 2016.12.01 installation ISO supplies a mirror list that can easily be filtered for your (nearby) country. An example command for the country "Netherlands":<br />
{{bc|<nowiki># grep -A1 --no-group-separator Netherlands /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist.backup</nowiki>}}<br />
<br />
==== Automated ====<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG="$Cnt" '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# curl -o /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Canada ===<br />
<br />
*https://na.mirrors.coltondrg.com/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://mirrors.geekpie.org/archlinux/ - ''Geek Pie Association @ ShanghaiTech University''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University(Legacy)''<br />
*https://mirrors.sjtug.org/archlinux/ - ''Shanghai Jiaotong University Linux User Group''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
*https://mirrors.nju.edu.cn/archlinux/ - ''Nanjing University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
*https://eu.mirrors.coltondrg.com/archlinux/<br />
<br />
=== Germany ===<br />
<br />
*http://delta.0web.ir/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
<br />
=== Indonesia ===<br />
<br />
*http://kambing.ui.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
*http://repo.sadjad.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
*http://mirror.archlinuxjp.org/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
<br />
=== Netherlands ===<br />
<br />
*http://mirror.transip.net/archlinux/ ''TransIP B.V.''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== Sweden ===<br />
<br />
*http://foss.dhyrule.se/linux/archlinux/ <br />
*ftp://foss.dhyrule.se/linux/archlinux/<br />
<br />
=== Thailand ===<br />
<br />
* http://mirror1.ku.ac.th/archlinux/<br />
<br />
=== United States ===<br />
<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://mirror.ziemer.bz/archlinux<br />
* https://lug.mines.edu/mirrors/archlinux/<br />
<br />
=== Sourceforge (old ISOs) ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only for getting older ISOs.''</div>Yaoge123https://wiki.archlinux.org/index.php?title=Mirrors&diff=479773Mirrors2017-06-14T08:00:44Z<p>Yaoge123: Add Nanjing Univ. Mirror</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-hans:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] page on the main site.<br />
<br />
Check the status of the Arch mirrors by visiting the [https://www.archlinux.org/mirrors/status/ Mirror Status] page. It is recommended to only use mirrors that are up to date, i.e. not out of sync.<br />
<br />
If you want your mirror to be added to the official list, see [[DeveloperWiki:NewMirrors]]. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP due to [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, a new connection to server has to be established each time ''pacman'' requests a package to be downloaded, which results in a brief pause.<br />
}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|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]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, issue the following command:<br />
# pacman -Syyu<br />
<br />
Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues. See also [https://bbs.archlinux.org/viewtopic.php?id=163124 Is -Syy safe?].<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. To set a priority to mirrors, the mirrorlist file has to be sorted manually or using a script.<br />
<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of sync. Instead, make a list of mirrors sorted by their [[#List by speed|speed]], then remove those from the list that are out of sync according to their [https://www.archlinux.org/mirrors/status/ status].<br />
<br />
It is recommended to repeat this process before every system upgrade to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== List by speed ===<br />
<br />
{{Remove|1=''rankmirrors'' will be removed from {{Pkg|pacman}} in the next release.[https://git.archlinux.org/pacman.git/commit/contrib/rankmirrors.sh.in?id=0c99eabd50752310f42ec808c8734a338122ec86]}}<br />
<br />
The {{Pkg|pacman}} package provides a Bash script, {{ic|/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.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
=== Server-side ranking ===<br />
<br />
The official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] provides an easy way to obtain a ranked list of mirrors. Because all ranking is done on a single server that takes multiple factors into account, the amount of load on the mirrors and the clients is significantly lower compared to ranking on each individual client.<br />
<br />
There are multiple scripts automating the update of the mirrorlist from the ranking server:<br />
<br />
* [[Reflector]] retrieves the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filters the most up-to-date mirrors, sorts them by speed and overwrites the {{ic|/etc/pacman.d/mirrorlist}} file.<br />
* [https://github.com/Gen2ly/armrr armrr] downloads a ranked mirrorlist for a specific country from the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] and creates a backup of the previous mirrorlist.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
==== Once during installation from live medium ====<br />
The 2016.12.01 installation ISO supplies a mirror list that can easily be filtered for your (nearby) country. An example command for the country "Netherlands":<br />
{{bc|<nowiki># grep -A1 --no-group-separator Netherlands /etc/pacman.d/mirrorlist > /etc/pacman.d/mirrorlist.backup</nowiki>}}<br />
<br />
==== Automated ====<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG="$Cnt" '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# curl -o /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Canada ===<br />
<br />
*https://na.mirrors.coltondrg.com/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://mirrors.geekpie.org/archlinux/ - ''Geek Pie Association @ ShanghaiTech University''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University(Legacy)''<br />
*https://mirrors.sjtug.org/archlinux/ - ''Shanghai Jiaotong University Linux User Group''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
*https://mirror.nju.edu.cn/archlinux/ - ''Nanjing University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
*https://eu.mirrors.coltondrg.com/archlinux/<br />
<br />
=== Germany ===<br />
<br />
*http://delta.0web.ir/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
<br />
=== Indonesia ===<br />
<br />
*http://kambing.ui.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
*http://repo.sadjad.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
*http://mirror.archlinuxjp.org/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
<br />
=== Netherlands ===<br />
<br />
*http://mirror.transip.net/archlinux/ ''TransIP B.V.''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== Sweden ===<br />
<br />
*http://foss.dhyrule.se/linux/archlinux/ <br />
*ftp://foss.dhyrule.se/linux/archlinux/<br />
<br />
=== Thailand ===<br />
<br />
* http://mirror1.ku.ac.th/archlinux/<br />
<br />
=== United States ===<br />
<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://mirror.ziemer.bz/archlinux<br />
* https://lug.mines.edu/mirrors/archlinux/<br />
<br />
=== Sourceforge (old ISOs) ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only for getting older ISOs.''</div>Yaoge123