Ubuntu 10.04 でリポジトリの更新すると何か変なエラーが出るという話。

Ubuntu 10.04 Lucid Lynxリポジトリの更新するとaptが何か変なエラーを吐いた。
apt-get update とかすると

http://packages.medibuntu.org/dists/lucid/Release.gpg の取得に失敗しました Something wicked happened resolving 'packages.medibuntu.org:http' (-5 - No address associated with hostname)
http://ppa.launchpad.net/shawn-p-huang/ppa/ubuntu/dists/lucid/Release.gpg の取得に失敗しました Something wicked happened resolving 'ppa.launchpad.net:http' (-5 - No address associated with hostname)
http://archive.ubuntulinux.jp/ubuntu/dists/lucid/Release.gpg の取得に失敗しました Something wicked happened resolving 'archive.ubuntulinux.jp:http' (-5 - No address associated with hostname)

とか出た。


この問題(バグ)は
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/574886
ここで的確に説明されてる。
で、ここの #28 に一つの解決策があって、ルーター無しで直接モデムと接続すればいい、らしい。
また、もう一つの解決策が #28 のリンクにあって、以下に書く。


http://ubuntu-ky.ubuntuforums.org/showthread.php?t=1475399&page=2
ここの #17 を引用する。

Unless you've already changed one of these settings, what's basically happening is that NetworkManager is setting your router up as the DNS server, and the router should use your ISP's DNS server to resolve addresses. Somewhere in there, addresses aren't all being resolved correctly, hence "no address associated with hostname". If you want to see what's being used to resolve addresses, open /etc/resolv.conf

NetworkManager can easily be set up to always use a manually-specified DNS server when using a given network. Under "Edit Connections..." select the network where the issue is occurring (selecting the proper tab at the top, if necessary), and click Edit. Under the "IPv4 Settings" tab, set the Method to "Automatic (DHCP) addresses only" and enter a third-party DNS server (e.g., Google's 8.8.8.8 ).

NetworkManager が、ルーターDNS サーバとして設定していて、アドレスの解決がうまくいかない、らしい(多分)。なので /etc/resolv.conf をいじればいいそう。
というわけで、 /etc/resolv.conf を管理者権限で開いて、 nameserver のところを、ルータのIPから自分の使ってるISPDNSサーバのIPに変更したら、リポジトリを更新してもエラーが出ないようになった。


ああホッとした。一ヶ月くらいずっとこんな感じだったので。でもこれも場当たり的な解決策だが…。
そのうち誰か直してくれるだろうか。

(追記: 2010-06-01
この方法は一時的なもので、次に再起動すると元に戻ってしまう。
GUI で設定でき、再起動しても有効な方法は:
表示パネルにあるネットワーク接続のアイコンを右クリック→接続の編集
有線タブなり無線タブなりでネットワーク接続の名前を選択→編集ボタンをクリック
IPv4 設定」タブ→「メソッド(M)」プルダウンで「自動 (DHCP) アドレスのみ」を選択→「DNS サーバ」欄に利用する DNS サーバーのアドレスを(複数ある場合はコンマ区切りで)入力→「適用」
これで、ログインし直せば設定が適用されるようだ。


心なしかWebページ表示の反応が速くなった気がする。ルーターって結構ボトルネックになってるのかもなあ。
)