Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing R from CRAN Ubuntu repository: No Public Key Error

Tags:

linux

r

apt

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.

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 

and get the following error when trying to update R on the CRAN mirror closest to me:

Reading package lists... Done

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 image 917
Btibert3 Avatar asked Apr 21 '12 00:04

Btibert3


2 Answers

The simplest solution that worked for me was from Emre Sahin in this thread:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9  
like image 76
Brian Bowman Avatar answered Oct 08 '22 21:10

Brian Bowman


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:

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.

If you have not already done this, this will probably fix your issue.

like image 23
Paul Hiemstra Avatar answered Oct 08 '22 20:10

Paul Hiemstra