Difference between revisions of "Mirrors (简体中文)"
(→中国镜像) |
|||
(45 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category: | + | [[Category:About Arch (简体中文)]] |
− | [[Category: | + | [[Category:Package management (简体中文)]] |
− | [[ | + | [[ar:Mirrors]] |
+ | [[en:Mirrors]] | ||
+ | [[es:Mirrors]] | ||
+ | [[fr:Miroirs]] | ||
+ | [[it:Mirrors]] | ||
+ | {{Article summary start|摘要}} | ||
+ | {{Article summary text|更新和管理软件包镜像}} | ||
+ | {{Article summary heading|相关}} | ||
+ | {{Article summary wiki|Mirroring}} | ||
+ | {{Article summary wiki|pacman}} | ||
+ | {{Article summary wiki|reflector}} | ||
+ | {{Article summary end}} | ||
− | + | 本页面说明如何选择和配置镜像,以及列出可用的镜像。 | |
− | |||
− | |||
− | |||
+ | == 启用您喜爱的镜像 == | ||
− | == | + | 想要启用镜像,打开 {{ic|/etc/pacman.d/mirrorlist}} 并定位到你的地理区域。对您想使用的镜像取消注释。 |
+ | {{注意 | ftp.archlinux.org [https://www.archlinux.org/news/302/ 限速 50KB/s]}} 例如: | ||
+ | |||
+ | # Any | ||
+ | # Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki> | ||
+ | '''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>''' | ||
+ | |||
+ | 参见 [[#镜像状态]] 和 [[#按速度排序]] 查看帮助选择镜像的工具。 | ||
− | + | {{小贴士|取消5个你最喜欢的镜像的注释,把他们放在 mirrorlist 文件最上方。这样你就很容易找到它们并且如果第一个镜像出问题可以很容易切换。这也让合并 mirrorlist 更新更容易。}} | |
+ | 也可以在 {{ic|/etc/pacman.conf}} 中指定镜像。对于 ''[core]'' 仓库,默认设置是: | ||
[core] | [core] | ||
Include = /etc/pacman.d/mirrorlist | Include = /etc/pacman.d/mirrorlist | ||
− | + | 想要使用 ''HostEurope'' 镜像作为默认镜像,把它添加在 {{Ic|Include}} 行之前: | |
− | |||
[core] | [core] | ||
− | Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/ | + | '''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>''' |
Include = /etc/pacman.d/mirrorlist | Include = /etc/pacman.d/mirrorlist | ||
− | |||
− | |||
− | + | pacman 会首先尝试链接这个镜像。如果需要的话,可以继续修改''[testing]'', ''[extra]'', 和 ''[community]''部分。 | |
− | + | {{注意|如果镜像直接在 {{ic|pacman.conf}} 中声明,记得在所有的仓库使用同样的镜像。否则不相容的包就可能被安装。如 ''[core]'' 中的 linux 和 ''[extra]'' 中的旧的内核模块不相容。}} | |
− | == | + | ==镜像状态== |
+ | 可以通过访问如下网址检查镜像的状态: | ||
+ | * https://www.archlinux.org/mirrors/status/ | ||
+ | * http://www.archlinux.de/?page=MirrorStatus | ||
− | + | 从[https://www.archlinux.org/mirrorlist/ 这里]可以自动生成最新的镜像列表,安装[[Reflector]]这个工具也可以自动检查和生成镜像列表。 | |
− | + | ==镜像排序== | |
− | + | ===按速度排序=== | |
− | + | 更快的源可以显著的提升pacman的性能,和arch的整体操作体验。可以使用 {{ic|rankmirrors}} 将镜像列表按速度排列。但是{{ic|rankmirrors}}不能测试这些源的速度。 | |
− | |||
− | |||
− | |||
− | + | {{ic|cd}}到{{ic|/etc/pacman.d/}}目录: | |
+ | {{bc|# cd /etc/pacman.d}} | ||
− | + | 备份已经存在的{{ic|/etc/pacman.d/mirrorlist}}: | |
+ | {{bc|# cp mirrorlist mirrorlist.backup}} | ||
− | + | 编辑{{ic|/etc/pacman.d/mirrorlist.backup}},取消要测速镜像前的注释。 | |
− | |||
− | |||
− | + | 让rankmirrors带上参数{{ic|-n}}对这个备份文件{{ic|mirrorlist.backup}}执行操作,然后把输出重定向以方便生成一个新的/etc/pacman.d/mirrorlist源列表: | |
− | + | {{bc|# rankmirrors -n 6 mirrorlist.backup > mirrorlist}} | |
+ | {{注意|'''-n 6''':将生成6个最接近的源,运行{{Ic|rankmirrors -h}}可查看所有可用选项。}} | ||
− | + | '''强制 pacman 刷新软件包列表''': | |
− | + | # pacman -Syy | |
− | + | {{Tip|传入两次{{Ic|--refresh}}或{{Ic|-y}}将强制更新所有软件包列表,即使系统认为它们已经是最新。'''每次修改镜像之后都应该使用{{Ic|pacman -Syy}}'''。}} | |
− | |||
− | |||
− | === | + | ===按速度和状态排序=== |
− | + | 仅是使用最快的镜像服务器并不是一件好事,因为它们可能是过时的。我们更推荐先[[#按速度排序]],然后在选出的镜像中按[[#镜像状态]]排序。 | |
− | + | 只要简单地访问它们的[[#镜像状态]]连接,然后将它们按照尽量新的顺序排序。将越新的镜像排到{{ic|/etc/pacman.d/mirrorlist}}的越上面。如果镜像真的太过时了,别用它们(把它们注释掉,然后再[[#按速度排序]]),重复这么做,排除过时的镜像。最后将有6个又快又新的镜像。 | |
− | |||
− | + | 当出现镜像问题是,应该重复上面的步骤。或者一段时间就重复一次以保持{{ic|/etc/pacman.d/mirrorlist}}最新,即使没有镜像问题。 | |
− | |||
− | === | + | ===自动使用Pacman Mirrorlist Generator的脚本=== |
− | + | 你可以使用下面的脚本来更新你的镜像列表。该脚本基于[https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator]给出的顺序。如果你不在美国,你可以更改国家变量。 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | + | {{hc|updatemirrors.sh|2=<nowiki>#!/bin/sh |
− | |||
− | |||
− | == | + | [ "$UID" != 0 ] && su=sudo |
− | |||
− | == | + | country='us' |
− | + | url="https://www.archlinux.org/mirrorlist/?country=$country&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on" | |
− | == | + | tmpfile=$(mktemp --suffix=-mirrorlist) |
− | |||
− | + | # 获得最新的镜像列表,并保存到 tmpfile | |
− | + | wget -qO- "$url" | sed 's/^#Server/Server/g' > "$tmpfile" | |
− | + | # 备份并替换现有的镜像列表 | |
− | + | { echo "Backing up the original mirrorlist..." | |
+ | $su mv -i /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig; } && | ||
+ | { echo "Rotating the new list into place..." | ||
+ | $su mv -i "$tmpfile" /etc/pacman.d/mirrorlist; }</nowiki>}} | ||
− | + | {{Note|你需要复制上面的文本,放到一文件中,然后对该文件运行{{Ic|chmod +x}}。如果你现在不是以Root的身份登录,当需要替换mirrorlist的时候,这个脚本将会调用sudo}} | |
− | |||
− | |||
− | === | + | ===使用 Reflector=== |
− | |||
− | + | [[Reflector]]工具可以从[https://www.archlinux.org/mirrors/status/ 镜像状态]页面自动获取最新的镜像列表,过滤掉未及时同步的镜像,然后按照速度排序覆盖{{ic|/etc/pacman.d/mirrorlist}}。 | |
− | |||
− | |||
− | |||
− | == | + | ==官方镜像== |
− | + | 官方镜像可以通过软件包 {{pkg|pacman-mirrorlist}} 获得。最新的镜像可以通过[https://www.archlinux.org/mirrorlist/ Pacman 镜像列表生成器]查询。 | |
− | + | 如果没有配置任何镜像,也没有安装 {{Ic|pacman-mirrorlist}},请运行如下命令: | |
− | + | # wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki> | |
− | + | 取消选中镜像前的注释然后: | |
− | + | # pacman -Syy | |
− | + | # pacman -S --force pacman-mirrorlist | |
− | + | 如果要将自己的镜像加入官方列表,请提出申请并将其加入下面的 [[#非官方镜像]] 列表。 | |
− | |||
− | |||
− | + | 如果碰到 {{ic|$arch}} 变量未定义的问题,请在 {{ic|/etc/pacman.conf}} 中加入: | |
− | + | Architecture = auto | |
− | === | + | === 支持 IPv6 的镜像 === |
− | + | [https://www.archlinux.org/mirrorlist/?country=all&protocol=http&ip_version=6 pacman 镜像列表生成工具] 可以用来查找当前的 IPv6 镜像。 | |
− | == | + | ==非官方镜像== |
− | + | 镜像'''没有'''加入{{ic|/etc/pacman.d/mirrorlist}}. | |
− | |||
− | === | + | ===全球=== |
− | * | + | * http://sourceforge.net/projects/archlinux/files/ - ''Does not have recent ISO releases. Use it only if for getting older ISOs.'' |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | === | + | ===保加利亚=== |
− | * | + | *http://mirror.telepoint.bg/archlinux/ |
+ | *ftp://mirror.telepoint.bg/archlinux/ | ||
− | == | + | ===中国=== |
− | + | '''中国电信''' | |
− | + | *http://mirror.lupaworld.com/archlinux/ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | '''中国联通''' | |
− | ''' | + | *http://mirrors.sohu.com/archlinux/ |
− | + | '''教育网''' | |
− | *http:// | + | *http://mirrors.zju.edu.cn/archlinux/ - "浙江大学" |
+ | *http://ftp.sjtu.edu.cn/archlinux/ - ''上海交通大学'' | ||
+ | *ftp://ftp.sjtu.edu.cn/archlinux/ | ||
+ | *http://mirrors.ustc.edu.cn/archlinux/ - ''中国科学技术大学'' | ||
+ | *ftp://mirrors.ustc.edu.cn/archlinux/ | ||
+ | *http://mirrors.tuna.tsinghua.edu.cn/archlinux/ - ''清华大学'' | ||
+ | *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/ - ''兰州大学'' | ||
− | + | ===德国=== | |
− | *ftp:// | + | *http://ftp.uni-erlangen.de/mirrors/archlinux/ |
− | + | *ftp://ftp.uni-erlangen.de/mirrors/archlinux/ | |
+ | *http://ftp.u-tx.net/archlinux/ | ||
+ | *ftp://ftp.u-tx.net/archlinux/ | ||
− | + | ===印度尼西亚=== | |
− | *http:// | + | *http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia'' |
+ | *http://kambing.ui.ac.id/archlinux/ | ||
+ | *http://repo.ukdw.ac.id/archlinux/ | ||
+ | |||
+ | ===立陶宛=== | ||
+ | *http://edacval.homelinux.org/mirrors/archlinux/ - ''Only from LT, without ISO'' | ||
+ | |||
+ | ===马来西亚=== | ||
*http://mirror.oscc.org.my/archlinux/ | *http://mirror.oscc.org.my/archlinux/ | ||
+ | *http://mirrors.inetutils.net/archlinux/ - ''ISO and Core'' | ||
+ | |||
+ | ===新西兰=== | ||
+ | *http://mirror.ihug.co.nz/archlinux/ | ||
+ | *http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only'' | ||
+ | |||
+ | ===俄罗斯=== | ||
+ | *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'' | ||
+ | |||
+ | ===南非=== | ||
+ | *http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ - ''Stellenbosch University'' | ||
+ | *ftp://ftp.sun.ac.za/pub/mirrors/archlinux/ | ||
+ | *http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town'' | ||
+ | *ftp://ftp.leg.uct.ac.za/pub/linux/arch/ | ||
+ | |||
+ | ===美国=== | ||
+ | * http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19'' | ||
+ | * http://mirror.pointysoftware.net/archlinux/ | ||
+ | |||
+ | ==疑难解答== | ||
+ | {{Translateme (简体中文)}} | ||
+ | ===Out-of-sync mirrors: corrupted packages/file not found=== | ||
+ | <!-- Here or [[pacman]]? Seems like a mirror issue more than pacman... --> | ||
+ | Issues regarding out-of-sync mirrors pointed out in [https://www.archlinux.org/news/482/ 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 {{Ic|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 {{Ic|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. | ||
+ | |||
+ | ===使用所有镜像=== | ||
+ | To emulate {{Ic|pacman -Su}}'s behavior of going through the entire mirror list, use this script: | ||
+ | {{hc|~/bin/pacup|<nowiki> | ||
+ | #!/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/,') | ||
+ | </nowiki>}} | ||
− | + | ===Checking multiple mirrors with paccheck=== | |
− | + | The paccheck script can be used: | |
− | + | * to compare pacman sync databases and package desc files to different mirrors, | |
− | * | + | * to verify size of packages in pacman cache |
+ | * to optionally compare packages in pacman cache to selected mirror(s). | ||
− | + | The script is intended to help to detect compromised mirrors, before the official implementation of [[package signing]]. It is destined for those who may want a little more assurance against some possible hacking scenarios of mirror servers. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | The Full System Update Procedure is: | |
− | + | # Run ''paccheck'' as a non-root user. Pacman will be synchronised and the needed packages will be downloaded. | |
− | # | + | # Examine report |
+ | # If no package ''mismatch'', then run {{ic|pacman -Su}} as root to update your system | ||
− | + | The script can be found in the [[Arch User Repository|AUR]]: {{AUR|paccheck}} | |
− | |||
− | |||
− | |||
− | + | == 参见 == | |
− | + | * [[http://wiki.gotux.net/code:bash:mirup MirUp]] -- pacman mirrorlist downloader/checker | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 04:06, 15 June 2013
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
本页面说明如何选择和配置镜像,以及列出可用的镜像。
启用您喜爱的镜像
想要启用镜像,打开 /etc/pacman.d/mirrorlist
并定位到你的地理区域。对您想使用的镜像取消注释。
# Any # Server = ftp://mirrors.kernel.org/archlinux/$repo/os/$arch Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch
参见 #镜像状态 和 #按速度排序 查看帮助选择镜像的工具。
也可以在 /etc/pacman.conf
中指定镜像。对于 [core] 仓库,默认设置是:
[core] Include = /etc/pacman.d/mirrorlist
想要使用 HostEurope 镜像作为默认镜像,把它添加在 Include
行之前:
[core] Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch Include = /etc/pacman.d/mirrorlist
pacman 会首先尝试链接这个镜像。如果需要的话,可以继续修改[testing], [extra], 和 [community]部分。
镜像状态
可以通过访问如下网址检查镜像的状态:
从这里可以自动生成最新的镜像列表,安装Reflector这个工具也可以自动检查和生成镜像列表。
镜像排序
按速度排序
更快的源可以显著的提升pacman的性能,和arch的整体操作体验。可以使用 rankmirrors
将镜像列表按速度排列。但是rankmirrors
不能测试这些源的速度。
cd
到/etc/pacman.d/
目录:
# cd /etc/pacman.d
备份已经存在的/etc/pacman.d/mirrorlist
:
# cp mirrorlist mirrorlist.backup
编辑/etc/pacman.d/mirrorlist.backup
,取消要测速镜像前的注释。
让rankmirrors带上参数-n
对这个备份文件mirrorlist.backup
执行操作,然后把输出重定向以方便生成一个新的/etc/pacman.d/mirrorlist源列表:
# rankmirrors -n 6 mirrorlist.backup > mirrorlist
强制 pacman 刷新软件包列表:
# pacman -Syy
--refresh
或-y
将强制更新所有软件包列表,即使系统认为它们已经是最新。每次修改镜像之后都应该使用pacman -Syy
。按速度和状态排序
仅是使用最快的镜像服务器并不是一件好事,因为它们可能是过时的。我们更推荐先#按速度排序,然后在选出的镜像中按#镜像状态排序。
只要简单地访问它们的#镜像状态连接,然后将它们按照尽量新的顺序排序。将越新的镜像排到/etc/pacman.d/mirrorlist
的越上面。如果镜像真的太过时了,别用它们(把它们注释掉,然后再#按速度排序),重复这么做,排除过时的镜像。最后将有6个又快又新的镜像。
当出现镜像问题是,应该重复上面的步骤。或者一段时间就重复一次以保持/etc/pacman.d/mirrorlist
最新,即使没有镜像问题。
自动使用Pacman Mirrorlist Generator的脚本
你可以使用下面的脚本来更新你的镜像列表。该脚本基于Pacman Mirrorlist Generator给出的顺序。如果你不在美国,你可以更改国家变量。
updatemirrors.sh
#!/bin/sh [ "$UID" != 0 ] && su=sudo country='us' url="https://www.archlinux.org/mirrorlist/?country=$country&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on" tmpfile=$(mktemp --suffix=-mirrorlist) # 获得最新的镜像列表,并保存到 tmpfile wget -qO- "$url" | sed 's/^#Server/Server/g' > "$tmpfile" # 备份并替换现有的镜像列表 { echo "Backing up the original mirrorlist..." $su mv -i /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig; } && { echo "Rotating the new list into place..." $su mv -i "$tmpfile" /etc/pacman.d/mirrorlist; }
chmod +x
。如果你现在不是以Root的身份登录,当需要替换mirrorlist的时候,这个脚本将会调用sudo使用 Reflector
Reflector工具可以从镜像状态页面自动获取最新的镜像列表,过滤掉未及时同步的镜像,然后按照速度排序覆盖/etc/pacman.d/mirrorlist
。
官方镜像
官方镜像可以通过软件包 pacman-mirrorlist 获得。最新的镜像可以通过Pacman 镜像列表生成器查询。
如果没有配置任何镜像,也没有安装 pacman-mirrorlist
,请运行如下命令:
# wget -O /etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/
取消选中镜像前的注释然后:
# pacman -Syy # pacman -S --force pacman-mirrorlist
如果要将自己的镜像加入官方列表,请提出申请并将其加入下面的 #非官方镜像 列表。
如果碰到 $arch
变量未定义的问题,请在 /etc/pacman.conf
中加入:
Architecture = auto
支持 IPv6 的镜像
pacman 镜像列表生成工具 可以用来查找当前的 IPv6 镜像。
非官方镜像
镜像没有加入/etc/pacman.d/mirrorlist
.
全球
- http://sourceforge.net/projects/archlinux/files/ - Does not have recent ISO releases. Use it only if for getting older ISOs.
保加利亚
中国
中国电信
中国联通
教育网
- http://mirrors.zju.edu.cn/archlinux/ - "浙江大学"
- http://ftp.sjtu.edu.cn/archlinux/ - 上海交通大学
- ftp://ftp.sjtu.edu.cn/archlinux/
- http://mirrors.ustc.edu.cn/archlinux/ - 中国科学技术大学
- ftp://mirrors.ustc.edu.cn/archlinux/
- http://mirrors.tuna.tsinghua.edu.cn/archlinux/ - 清华大学
- 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/ - 兰州大学
德国
- http://ftp.uni-erlangen.de/mirrors/archlinux/
- ftp://ftp.uni-erlangen.de/mirrors/archlinux/
- http://ftp.u-tx.net/archlinux/
- ftp://ftp.u-tx.net/archlinux/
印度尼西亚
- http://mirror.kavalinux.com/archlinux/ - only from Indonesia
- http://kambing.ui.ac.id/archlinux/
- http://repo.ukdw.ac.id/archlinux/
立陶宛
- http://edacval.homelinux.org/mirrors/archlinux/ - Only from LT, without ISO
马来西亚
新西兰
俄罗斯
- http://hatred.homelinux.net/archlinux/ - Vladivostok, without iso, with 3SPY project repos and mingw32 repo
南非
- http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ - Stellenbosch University
- ftp://ftp.sun.ac.za/pub/mirrors/archlinux/
- http://ftp.leg.uct.ac.za/pub/linux/arch/ - University of Cape Town
- ftp://ftp.leg.uct.ac.za/pub/linux/arch/
美国
- http://archlinux.linuxfreedom.com - Contains numerous ISO images but does not contain the ISO dated 2011.08.19
- http://mirror.pointysoftware.net/archlinux/
疑难解答
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.
使用所有镜像
To emulate pacman -Su
's behavior of going through the entire mirror list, use this script:
~/bin/pacup
#!/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/,')
Checking multiple mirrors with paccheck
The paccheck script can be used:
- to compare pacman sync databases and package desc files to different mirrors,
- to verify size of packages in pacman cache
- to optionally compare packages in pacman cache to selected mirror(s).
The script is intended to help to detect compromised mirrors, before the official implementation of package signing. It is destined for those who may want a little more assurance against some possible hacking scenarios of mirror servers.
The Full System Update Procedure is:
- Run paccheck as a non-root user. Pacman will be synchronised and the needed packages will be downloaded.
- Examine report
- If no package mismatch, then run
pacman -Su
as root to update your system
The script can be found in the AUR: paccheckAUR
参见
- [MirUp] -- pacman mirrorlist downloader/checker