Mirrors (日本語)
| 概要 |
|---|
| パッケージミラーのアップデートと管理 |
| 関連項目 |
| Mirroring |
| pacman (日本語) |
| reflector |
このページにはミラーの選択と設定のガイドと現在利用できるミラーのリストがあります。
Contents |
特定のミラーを有効にする
ミラーを有効にするには、/etc/pacman.d/mirrorlist を開きあなたの国の部分を見て下さい。あなたが使いたいミラーをアンコメントします。
例:
# Japan # Server = ftp://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
ミラーの選択を助けるツールについては #ミラーの状態 や #速度でリストアップ を見て下さい。
/etc/pacman.conf でミラーを指定することも可能です。[core] リポジトリのデフォルトの設定は以下の通りです:
[core] Include = /etc/pacman.d/mirrorlist
JAIST のミラーをデフォルトのミラーとして使いたい場合、Include 行の前に次を追加してください:
[core] Server = ftp://ftp.jaist.ac.jp/pub/Linux/ArchLinux/core/os/$arch Include = /etc/pacman.d/mirrorlist
pacman は最初にこのミラーに接続を試行するようになります。同じように [testing], [extra], [community] でミラーを設定することができます。
ミラーの状態
Arch ミラーの状態やアップデートの頻度を確認するには https://www.archlinux.org/mirrors/status/ や http://www.archlinux.de/?page=MirrorStatus を見て下さい。
最新のミラーリストをここで生成することができます。ミラーリストの生成はスクリプトを使ったり、Mirrorcheck を使って生成する Reflector をインストールすることで自動化可能です。ミラーの更新状態を手動で確認するには:
- サーバーの "extra/os/" をブラウズ;
- 他のタブ・ウィンドウで https://www.archlinux.org/ にアクセス;
- ミラーの
i686ディレクトリの最終更新日とホームページの右の Package Repositories にある [extra] の日付を比較する。
ミラーをソートする
更新頻度と速度でミラーをソートする reflector を使わない場合、以下の方法で手動でミラーをソートしてください。
速度でリストアップ
Bash スクリプト /usr/bin/rankmirrors で最速のローカルミラーを決定することができます。
既存の /etc/pacman.d/mirrorlist をバックアップしてください:
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
/etc/pacman.d/mirrorlist.backup を編集して rankmirrors でテストするミラーをアンコメントしてください。
全てのミラーをアンコメントしたいなら以下の sed を実行:
# sed '/^#\S/ s|#||' -i /etc/pacman.d/mirrorlist.backup
最後に、ミラーにランク付けをします。-n 6 は最速の6つのミラーを出力することを意味しています:
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
rankmirrors -h でオプションを全て一覧できます。
/etc/pacman.d/mirrorlist を作成・編集した後は pacman のパッケージリストを更新してください:
# pacman -Syy
速度と状態でリストアップ
最速のミラーだけを使うのはいいアイデアとは言えません。最速のミラーの更新が遅れることがありえるからです。#速度でリストアップ をして #ミラーの状態 によって6つの最速のミラーをソートするのが好ましい方法です。
Simply visit either one or both #ミラーの状態 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.
Pacman Mirrorlist Generator の利用を自動化するスクリプト
以下のシェルスクリプトを使うことで Pacman Mirrorlist Generator によって作られたランキングに基づいてミラーをアップデートできるようになります。あなたの住んでいる国が日本ではないならば、country 変数を変えてください。
updatemirrors.sh
#!/bin/sh
[ "$UID" != 0 ] && su=sudo
country='JP'
url="https://www.archlinux.org/mirrorlist/?country=$country&protocol=ftp&protocol=http&ip_version=4&use_mirror_status=on"
tmpfile=$(mktemp --suffix=-mirrorlist)
# Get latest mirror list and save to tmpfile
wget -qO- "$url" | sed 's/^#Server/Server/g' > "$tmpfile"
# Backup and replace current mirrorlist file (if new file is non-zero)
if [ -s "$tmpfile" ]
then
{ 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; }
else
echo " Unable to update, could not download list."
fi
# allow global read access (required for non-root yaourt execution)
chmod +r /etc/pacman.d/mirrorlist
Reflector を使う
Reflector を使えば、自動で MirrorStatus ページから最新のミラーリストを取得して、どのミラーが最新かフィルタリング・速度でソートして /etc/pacman.d/mirrorlist ファイルを上書きできます。
公式ミラー
公式の Arch Linux ミラーのリストは pacman-mirrorlist パッケージから入手できます。最新のミラーのリストがもっと欲しいならば、このサイトの Pacman Mirror List Generator ページを使ってください。
ありえないケースですが、もしあなたがミラーを設定しておらず 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 = x86_64
IPv6 対応ミラー
pacman mirror list generator を使って最新の IPv6 ミラーのリストを見つけることができます。
非公式ミラー
以下のミラーは /etc/pacman.d/mirrorlist に記載されていません。
グローバル
- http://sourceforge.net/projects/archlinux/files/ - ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.
TOR ネットワーク
シンガポール
ブルガリア
ベトナム
FPT TELECOM
中国
CHINA TELECOM
CHINA UNICOM
Cernet
- 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://delta.archlinux.fr/ - With Delta package support. Needs xdelta3 package from extra to run.
- http://mirror.soa1.org/archlinux
- ftp://mirror:mirror@mirror.soa1.org/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.michael-eckert.net/archlinux/
- http://linux.rz.rub.de/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
マレーシア
ニュージーランド
ポーランド
- 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/ - ステレンボス大学
- ftp://ftp.sun.ac.za/pub/mirrors/archlinux/
- http://ftp.leg.uct.ac.za/pub/linux/arch/ - ケープタウン大学
- ftp://ftp.leg.uct.ac.za/pub/linux/arch/
- http://mirror.ufs.ac.za/archlinux/ - ザ・フリーステイト大学
- ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/
- http://ftp.wa.co.za/pub/archlinux/ - Web Africa Networks
- ftp://ftp.wa.co.za/pub/archlinux/
- http://archlinux.mirror.ac.za - TENET - Tertiary Education and Research Network of South Africa
- ftp://archlinux.mirror.ac.za
アメリカ合衆国
- 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: 破損したパッケージ/ファイルが見つからない
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.
全てのミラーを使う
pacman -Su を全てのミラーリストで行う挙動をエミュレートするには、以下のスクリプトを使って下さい:
~/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/,')
参照
- MirUp – pacman mirrorlist downloader/checker