Oct 30, 2008

apt-get で Debian Unofficial からパッケージを取得する

"apt-cache search" で欲しいパッケージが見つからない。 そんなときに重宝するのが Debian Unofficial だそうだ。 Debian Unofficial では公式サイトにはないパッケージを多数用意してくれているということで "make" が面倒なものぐさ人間には非常に有り難い。

Debian Unofficial is a repository for packages not available within the official Debian repository. It contains packages which are not distributable within Debian due to special license terms as well as packages which are not included in Debian due to political reasons (e.g. alleged possible patent infrigement, binary-only/no sources, or special too restrictive licenses).
Debian Unofficial
http://www.debian-unofficial.org/

Debian Unofficial の設定

/etc/apt/sources.list に以下を追記する。

deb http://ftp.debian-unofficial.org/debian etch main contrib non-free restricted
deb-src http://ftp.debian-unofficial.org/debian etch main contrib non-free restricted

"GPG error" の対処

上記設定を行い、"apt-get update" を行うと、下記の様なエラーが出る。

# apt-get update
    (略)
Fetched 7605kB in 6s (1167kB/s)
Reading package lists... Done
W: GPG error: http://ftp.debian-unofficial.org etch Release: The following signatures
couldn't be verified because the public key is not available: NO_PUBKEY 394D199524C52AC3
W: You may want to run apt-get update to correct these problems
#
このエラーの対処方法は Debian Unofficial の FAQ に記載されている。
Debian Unofficial - 5. Frequently Asked Questions (FAQ)
http://www.debian-unofficial.org/faq.html
・・・が、この FAQ の通りに実行しても直らなかった。 エラーが直った対処方法は以下の通り。

まず、エラーメッセージにある PUBKEY から gpg コマンドを使用してキーを取得する。

# gpg --keyserver subkeys.pgp.net --recv-keys 394D199524C52AC3
gpg: requesting key 24C52AC3 from hkp server subkeys.pgp.net
gpg: key 24C52AC3: public key "Debian Unofficial Archive Automatic Signing Key (2007) " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
#
次に取得したキーを apt に登録する。
# gpg --armor --export 394D199524C52AC3 | apt-key add -
OK
#
これで OK。
# apt-get update
    (略)
Ign http://ftp.debian-unofficial.org etch/main Sources/DiffIndex
Ign http://ftp.debian-unofficial.org etch/contrib Sources/DiffIndex
Ign http://ftp.debian-unofficial.org etch/non-free Sources/DiffIndex
Ign http://ftp.debian-unofficial.org etch/restricted Sources/DiffIndex
Hit http://ftp.debian-unofficial.org etch/main Packages
Hit http://ftp.debian-unofficial.org etch/contrib Packages
Hit http://ftp.debian-unofficial.org etch/non-free Packages
Hit http://ftp.debian-unofficial.org etch/restricted Packages
Hit http://ftp.debian-unofficial.org etch/main Sources
Hit http://ftp.debian-unofficial.org etch/contrib Sources
Hit http://ftp.debian-unofficial.org etch/non-free Sources
Hit http://ftp.debian-unofficial.org etch/restricted Sources
Fetched 191B in 2s (82B/s)
Reading package lists... Done
#
ちなみに、apt に登録されたキーは以下で確認できる。
# apt-key list
/etc/apt/trusted.gpg
--------------------
    (略)
pub   1024D/24C52AC3 2007-01-24 [expired: 2008-02-01]
uid                  Debian Unofficial Archive Automatic Signing Key (2007) 
#
それにしても、既に失効済みの 2007 年のキーが必要なのは何故だろう? FAQ では 2008 年のキーをインストールする手順が記載されているのに。

TrackBack ping me at
http://www.in-vitro.jp/blog/index.cgi/Linux/20081030_01.trackback
Post a comment

writeback message: Ready to post a comment.