我在防火墙后面(我设置了代理 - 就像在为什么 add-apt-repository 现在无法检索我的代理服务器后面的密钥,但我可以更新软件包列表并手动接收密钥?)。我尝试了apt-get
一下,结果正如预期的那样,显示“检索密钥...超时失败”。我尝试了所有技巧,最后只能手动检索密钥。
这种手动技巧在某些地方有效,但在其他地方无效,这是我的问题。
$ sudo apt-add-repository ppa:rael-gc/scudcloud
ScudCloud is a non official desktop client app for Slack.
Slack (http://slack.com) is a platform for team communication.
Source: https://github.com/raelgc/scudcloud
To install it:
sudo apt-add-repository -y ppa:rael-gc/scudcloud
sudo apt-get update
sudo apt-get install scudcloud
More info: https://launchpad.net/~rael-gc/+archive/ubuntu/scudcloud
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmps2xm19n_/secring.gpg' created
gpg: keyring `/tmp/tmps2xm19n_/pubring.gpg' created
gpg: requesting key F4E3FBBE from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
我查找密钥http://keyserver.ubuntu.com(以 - 为前缀0x
,即0xF4E3FBBE
)并将公钥复制到文件中,例如/tmp/keyfile
。
$ sudo apt-key add /tmp/keyfile
> Ok
$ apt-key list
/etc/apt/trusted.gpg
--------------------
pub 1024D/437D05B5 2004-09-12
uid Ubuntu Archive Automatic Signing Key <[email protected]>
sub 2048g/79164387 2004-09-12
....
pub 4096R/F4E3FBBE 2014-04-15
uid Launchpad PPA for Rael
钥匙就在里面。
$ sudo apt-add-repository ppa:rael-gc/scudcloud
...
gpg: requesting key F4E3FBBE from hkp server keyserver.ubuntu.com
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
为什么它会再次尝试检索密钥?
幸运的是,这个步骤不是必需的,因为按照以下步骤操作即可成功:
$ sudo apt-get update
$ sudo apt-get install scudcloud
但是为什么 apt-add-repository 会尝试再次进行密钥服务器查找?
答案1
apt-add-repository
将要总是尝试获取密钥 - 它不会检查密钥环中是否已存在。如果需要,请提出功能请求。