从 CRAN Ubuntu 存储库安装 R:没有公钥错误 [英] Installing R from CRAN Ubuntu repository: No Public Key Error
问题描述
我使用的是 R 版本 2.13,并且想要更新到更新版本以使用一些依赖于 R>= 2.14 的软件包.
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.
如here.然后我导航到终端并输入:
I have the line to my sources.list file as found described here. I then navigate to the terminal and type:
sudo apt-get update
尝试在离我最近的 CRAN 镜像上更新 R 时出现以下错误:
and get the following error when trying to update R on the CRAN mirror closest to me:
正在阅读包裹清单...完成
Reading package lists... Done
W:GPG 错误:http://lib.stat.cmu.edu oneiric/发布:由于公钥不可用,无法验证以下签名:NO_PUBKEY 51716619E084DAB9
W: GPG error: http://lib.stat.cmu.edu oneiric/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
知道如何调试这个错误吗?
Any idea how to debug this error?
推荐答案
Like @Ben Bolker 评论(抱歉我劫持了您的评论,但正确答案尚未发布),在 debian 包 repo 的描述 有一个部分 secure apt
说:
Like @Ben Bolker commented (sorry I hijacked your commented, but the correct answer was not yet posted), in the description of the debian package repo there is a section secure apt
which says:
安全 APT
CRAN 上的 Debian 向后移植档案使用以下密钥签名Johannes Ranke(CRAN Debian 档案库)"带钥匙编号 381BA480.你可以用
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 或或者,使用另一个密钥服务器,
gpg --keyserver subkeys.pgp.net --recv-key 381BA480 or alternatively, using another key server,
gpg --keyserver pgp.mit.edu --recv-key 381BA480 如果没有正常工作,这可能是由于防火墙阻止了端口 11371.或者,您可以在以下位置搜索 0x381BA480http://keyserver.noreply.org/ 或 http://pgp.mit.edu/ 并将密钥块复制到纯文本中文件,例如命名为 jranke_cran.asc.
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.
如果使用 gpg 接收密钥确实有效,则需要将其导出到文本文件
If receiving the key with gpg did work, you need to export it to a text file
gpg -a --export 381BA480 > jranke_cran.asc 在这两种情况下你都需要通过运行让 apt 系统知道密钥
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 将 jranke_cran.asc 添加为 root.
apt-key add jranke_cran.asc as root.
如果您还没有这样做,这可能会解决您的问题.
If you have not already done this, this will probably fix your issue.
这篇关于从 CRAN Ubuntu 存储库安装 R:没有公钥错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!