72
66

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ubuntuで認証プロキシ配下からapt-keyを使うとき

Last updated at Posted at 2014-05-23

UbuntuにDockerをインストールする際(Docker installation Ubuntu Precise 12.04 (LTS) (64-bit))など、Ubuntu公式以外のリポジトリからパッケージを取得するためには、そのリポジトリを認証する鍵情報をローカルキーチェーンに取り込んでおく必要があります。

そのためapt-keyコマンドを用いるのですが、Proxy配下からだと上手く動きません。

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.41spwm8Ez8 --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
gpg: 鍵A88D21E9をhkpからサーバーkeyserver.ubuntu.comに要求
gpgkeys: key 36A1D7869245C8950F966E92D8576A8BA88D21E9 not found on keyserver
gpg: 有効なOpenPGPデータが見つかりません。
gpg: 処理数の合計: 0

このような場合、--keyserver-optionを使うと幸せになれます。

--keyserver-option http-proxy=http://<アカウント>:<パスワード>@プロキシサーバ:ポート

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-option http-proxy=http://x:y@proxy:port --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.oqJcUg9wwq --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-option http-proxy=http://x:y@proxy:port --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
gpg: 鍵A88D21E9をhkpからサーバーkeyserver.ubuntu.comに要求
gpg: 鍵A88D21E9: 公開鍵“Docker Release Tool (releasedocker) <docker@dotcloud.com>”を読み込みました
gpg: 処理数の合計: 1
gpg:               読込み: 1  (RSA: 1)
72
66
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
72
66

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?