Linux 从 CRAN Ubuntu 存储库安装 R:没有公钥错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10255082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing R from CRAN Ubuntu repository: No Public Key Error
提问by Btibert3
I am on R version 2.13 and would like to update to a newer version in order to use some packages that depend on R>= 2.14.
我使用的是 R 版本 2.13,并希望更新到更新版本以使用一些依赖于 R>= 2.14 的软件包。
I have the line to my sources.list file as found described here. I then navigate to the terminal and type:
我行我的sources.list文件FOUND描述这里。然后我导航到终端并输入:
sudo apt-get update
and get the following error when trying to update R on the CRAN mirror closest to me:
尝试在离我最近的 CRAN 镜像上更新 R 时出现以下错误:
Reading package lists... Done
W: GPG error: http://lib.stat.cmu.eduoneiric/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
阅读包裹清单...完成
W:GPG 错误:http://lib.stat.cmu.edu oneiric/ 发布:无法验证以下签名,因为公钥不可用:NO_PUBKEY 51716619E084DAB9
Any idea how to debug this error?
知道如何调试这个错误吗?
采纳答案by Paul Hiemstra
Like @Ben Bolker commented (sorry I hiHymaned your commented, but the correct answer was not yet posted), in the descriptionof the debian package repo there is a section secure apt
which says:
就像@Ben Bolker 评论的一样(对不起,我劫持了你的评论,但正确的答案还没有发布),在debian 包 repo的描述中有一个部分secure apt
说:
SECURE APT
The Debian backports archives on CRAN are signed with the key of "Johannes Ranke (CRAN Debian archive) " with key ID 381BA480. You can fetch this with
gpg --keyserver subkeys.pgp.net --recv-key 381BA480 or alternatively, using another key server,
gpg --keyserver pgp.mit.edu --recv-key 381BA480 If this doesn't work, it might be due to a firewall blocking port 11371. Alternatively, you can search for 0x381BA480 at http://keyserver.noreply.org/or http://pgp.mit.edu/and copy the key block into a plain text file, named, for instance, jranke_cran.asc.
If receiving the key with gpg did work, you need to export it to a text file
gpg -a --export 381BA480 > jranke_cran.asc In both cases you need to make the key known to the apt system by running
apt-key add jranke_cran.asc as root.
安全 APT
CRAN 上的 Debian 向后移植档案使用“Johannes Ranke(CRAN Debian 档案)”的密钥签名,密钥 ID 为 381BA480。你可以用
gpg --keyserver subkeys.pgp.net --recv-key 381BA480 或者,使用另一个密钥服务器,
gpg --keyserver pgp.mit.edu --recv-key 381BA480 如果这不起作用,可能是由于防火墙阻止了端口 11371。或者,您可以在http://keyserver.noreply.org搜索 0x381BA480 /或http://pgp.mit.edu/并将密钥块复制到纯文本文件中,例如命名为 jranke_cran.asc。
如果使用 gpg 接收密钥确实有效,则需要将其导出到文本文件
gpg -a --export 381BA480 > jranke_cran.asc 在这两种情况下,您都需要通过运行让 apt 系统知道密钥
apt-key 添加 jranke_cran.asc 作为 root。
If you have not already done this, this will probably fix your issue.
如果您还没有这样做,这可能会解决您的问题。
回答by Brian Bowman
The simplest solution that worked for me was from Emre Sahin in this thread:
对我有用的最简单的解决方案来自此线程中的Emre Sahin :
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
回答by Saurabh Chandra Patel
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYID
and replace KEYID with the number shown in the error message.
并将 KEYID 替换为错误消息中显示的数字。
回答by Denis
Here is a step-by-step answer that might be easier to follow.
这是一个可能更容易遵循的分步答案。
Fetch the key (the last 8 digits in the warning message):
gpg --keyserver pgp.mit.edu --recv-key E084DAB9
The output should look like this:
gpg: requesting key E084DAB9 from hkp server pgp.mit.edu gpg: key E084DAB9: public key "Michael Rutter <[email protected]>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1)
Add the key (superuser access required):
gpg -a --export E084DAB9 | sudo apt-key add -
Update the repositories:
sudo apt-get update
获取密钥(警告消息中的最后 8 位数字):
gpg --keyserver pgp.mit.edu --recv-key E084DAB9
输出应如下所示:
gpg: requesting key E084DAB9 from hkp server pgp.mit.edu gpg: key E084DAB9: public key "Michael Rutter <[email protected]>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1)
添加密钥(需要超级用户访问):
gpg -a --export E084DAB9 | sudo apt-key add -
更新存储库:
sudo apt-get update
There should be no warning about the missing key now.
现在应该没有关于丢失密钥的警告。
回答by Tollan Renner
I encountered the same issue and the only solution I found, perhaps due to a firewall, was to use the helpful Y PPA Manager. The two steps below outline has worked on Ubuntu 15.04.
我遇到了同样的问题,我找到的唯一解决方案(可能是由于防火墙的原因)是使用有用的 Y PPA 管理器。大纲下面的两个步骤适用于 Ubuntu 15.04。
1) First install the Y PPA Manager:
1)首先安装Y PPA Manager:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager
2) Then fetch missing keys by running the Y PPA Manager:
2) 然后通过运行 Y PPA Manager 获取丢失的密钥:
y-ppa-manager
Click "Advanced"
Next, click "Try to import missing GPG keys"
点击“高级”
接下来,单击“尝试导入丢失的 GPG 密钥”
Finally, update again to check if it works:
最后,再次更新以检查它是否有效:
sudo apt-get update
回答by petermeissner
Thanks to Philipp Burckhardt, I got it fixed.
感谢Philipp Burckhardt,我把它修好了。
Try this:
尝试这个:
gpg --keyserver pgpkeys.mit.edu --recv-key 51716619E084DAB9
gpg -a --export 51716619E084DAB9 | sudo apt-key add -
回答by Robert Casey
Much like others posted above, this one-liner seems to work well on Debian 6:
就像上面发布的其他人一样,这个单行似乎在 Debian 6 上运行良好:
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 381BA480
Executing: gpg --ignore-time-conflict --no-options
--no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys 381BA480
gpg: requesting key 381BA480 from hkp server pgp.mit.edu
gpg: key 381BA480: public key "Johannes Ranke (CRAN Debian archive) <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
回答by SummitK
This solved my problem
这解决了我的问题
$ wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add
$ wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add