W: GPG 错误:以下签名无法验证,因为公钥不可用。

在我的Ubuntu 14.04上,我按照http://mirror.its.dal.ca/cran/bin/linux/ubuntu/README的指示,将以下内容添加到/etc/apt/sources.list文件中。
deb http://stat.ethz.ch/CRAN/bin/linux/ubuntu trusty/

当我运行sudo apt-get update时,我会得到这个错误。
W: GPG error: http://stat.ethz.ch trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9

整个输出在这篇文章的末尾。 我想知道问题是什么意思,以及如何解决它?谢谢!
$ sudo apt-get update
Ign http://us.archive.ubuntu.com trusty InRelease
Ign http://us.archive.ubuntu.com trusty-updates InRelease                      
Ign http://dl.google.com stable InRelease                                      
Ign http://us.archive.ubuntu.com trusty-backports InRelease                    
Ign http://security.ubuntu.com trusty-security InRelease                       
Hit http://us.archive.ubuntu.com trusty Release.gpg                            
Hit http://security.ubuntu.com trusty-security Release.gpg                     
Hit http://us.archive.ubuntu.com trusty-updates Release.gpg                    
Ign http://dl.google.com stable InRelease                                      
Hit http://us.archive.ubuntu.com trusty-backports Release.gpg                  
Hit http://security.ubuntu.com trusty-security Release                         
Hit http://dl.google.com stable Release.gpg                                    
Hit http://us.archive.ubuntu.com trusty Release                                
Hit http://us.archive.ubuntu.com trusty-updates Release                        
Hit http://security.ubuntu.com trusty-security/main Sources                    
Ign http://extras.ubuntu.com trusty InRelease                                  
Hit http://dl.google.com stable Release.gpg                                    
Hit http://us.archive.ubuntu.com trusty-backports Release                      
Ign http://archive.canonical.com trusty InRelease                              
Hit http://security.ubuntu.com trusty-security/restricted Sources              
Hit http://us.archive.ubuntu.com trusty/main Sources                           
Hit http://dl.google.com stable Release                                        
Hit http://us.archive.ubuntu.com trusty/restricted Sources                     
Hit http://security.ubuntu.com trusty-security/universe Sources                
Hit http://us.archive.ubuntu.com trusty/universe Sources                       
Hit http://security.ubuntu.com trusty-security/multiverse Sources              
Hit http://security.ubuntu.com trusty-security/main amd64 Packages             
Hit http://dl.google.com stable Release                                        
Hit http://us.archive.ubuntu.com trusty/multiverse Sources                     
Hit http://extras.ubuntu.com trusty Release.gpg                                
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages       
Hit http://us.archive.ubuntu.com trusty/main amd64 Packages                    
Ign http://archive.canonical.com trusty InRelease                              
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages         
Hit http://us.archive.ubuntu.com trusty/restricted amd64 Packages              
Hit http://dl.google.com stable/main amd64 Packages                            
Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages       
Hit http://us.archive.ubuntu.com trusty/universe amd64 Packages                
Ign http://stat.ethz.ch trusty/ InRelease                                      
Hit http://security.ubuntu.com trusty-security/main i386 Packages              
Hit http://us.archive.ubuntu.com trusty/multiverse amd64 Packages              
Hit http://dl.google.com stable/main i386 Packages                             
Hit http://security.ubuntu.com trusty-security/restricted i386 Packages        
Hit http://us.archive.ubuntu.com trusty/main i386 Packages                     
Hit http://us.archive.ubuntu.com trusty/restricted i386 Packages               
Hit http://security.ubuntu.com trusty-security/universe i386 Packages          
Hit http://extras.ubuntu.com trusty Release                                    
Hit http://archive.canonical.com trusty Release.gpg                            
Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages        
Hit http://security.ubuntu.com trusty-security/main Translation-en             
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en       
Hit http://us.archive.ubuntu.com trusty/universe i386 Packages                 
Hit http://security.ubuntu.com trusty-security/restricted Translation-en       
Get:1 http://stat.ethz.ch trusty/ Release.gpg [490 B]                          
Hit http://dl.google.com stable/main amd64 Packages                            
Hit http://us.archive.ubuntu.com trusty/multiverse i386 Packages               
Hit http://archive.canonical.com trusty Release.gpg                            
Hit http://extras.ubuntu.com trusty/main Sources                               
Hit http://dl.google.com stable/main i386 Packages                             
Hit http://us.archive.ubuntu.com trusty/main Translation-en                    
Hit http://security.ubuntu.com trusty-security/universe Translation-en         
Hit http://us.archive.ubuntu.com trusty/multiverse Translation-en              
Hit http://stat.ethz.ch trusty/ Release                                        
Ign http://stat.ethz.ch trusty/ Release                                        
Hit http://extras.ubuntu.com trusty/main amd64 Packages                        
Hit http://us.archive.ubuntu.com trusty/restricted Translation-en              
Hit http://archive.canonical.com trusty Release                                
Hit http://us.archive.ubuntu.com trusty/universe Translation-en                
Hit http://us.archive.ubuntu.com trusty-updates/main Sources                   
Hit http://extras.ubuntu.com trusty/main i386 Packages                         
Hit http://us.archive.ubuntu.com trusty-updates/restricted Sources             
Hit http://archive.canonical.com trusty Release                                
Hit http://us.archive.ubuntu.com trusty-updates/universe Sources               
Ign http://stat.ethz.ch trusty/ Packages/DiffIndex                             
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Sources             
Hit http://us.archive.ubuntu.com trusty-updates/main amd64 Packages            
Hit http://us.archive.ubuntu.com trusty-updates/restricted amd64 Packages      
Hit http://us.archive.ubuntu.com trusty-updates/universe amd64 Packages        
Hit http://archive.canonical.com trusty/partner Sources                        
Hit http://us.archive.ubuntu.com trusty-updates/multiverse amd64 Packages      
Hit http://us.archive.ubuntu.com trusty-updates/main i386 Packages             
Ign https://private-ppa.launchpad.net precise InRelease                        
Hit http://archive.canonical.com trusty/partner amd64 Packages                 
Hit http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages       
Hit http://us.archive.ubuntu.com trusty-updates/universe i386 Packages         
Hit http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages       
Hit http://us.archive.ubuntu.com trusty-updates/main Translation-en            
Hit https://private-ppa.launchpad.net precise Release.gpg                      
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en      
Hit http://us.archive.ubuntu.com trusty-updates/restricted Translation-en      
Hit http://archive.canonical.com trusty/partner i386 Packages                  
Hit http://us.archive.ubuntu.com trusty-updates/universe Translation-en        
Hit http://us.archive.ubuntu.com trusty-backports/main Sources                 
Hit http://us.archive.ubuntu.com trusty-backports/restricted Sources           
Hit http://us.archive.ubuntu.com trusty-backports/universe Sources             
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Sources           
Hit http://stat.ethz.ch trusty/ Packages                                       
Hit https://private-ppa.launchpad.net precise Release                          
Hit http://us.archive.ubuntu.com trusty-backports/main amd64 Packages          
Hit http://us.archive.ubuntu.com trusty-backports/restricted amd64 Packages    
Hit http://us.archive.ubuntu.com trusty-backports/universe amd64 Packages      
Hit http://us.archive.ubuntu.com trusty-backports/multiverse amd64 Packages    
Hit http://us.archive.ubuntu.com trusty-backports/main i386 Packages           
Hit http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages     
Ign http://dl.google.com stable/main Translation-en_US                         
Hit http://archive.canonical.com trusty/partner Sources                        
Hit https://private-ppa.launchpad.net precise/main amd64 Packages              
Ign http://dl.google.com stable/main Translation-en                            
Hit http://us.archive.ubuntu.com trusty-backports/universe i386 Packages       
Ign http://dl.google.com stable/main Translation-en_US                         
Hit http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages     
Hit http://us.archive.ubuntu.com trusty-backports/main Translation-en          
Hit http://archive.canonical.com trusty/partner amd64 Packages                 
Hit https://private-ppa.launchpad.net precise/main i386 Packages               
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en    
Ign http://dl.google.com stable/main Translation-en                            
Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en    
Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en      
Hit http://archive.canonical.com trusty/partner i386 Packages                  
Ign http://extras.ubuntu.com trusty/main Translation-en_US                     
Ign http://us.archive.ubuntu.com trusty/main Translation-en_US                 
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US           
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US           
Ign http://extras.ubuntu.com trusty/main Translation-en                        
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US             
Ign http://archive.canonical.com trusty/partner Translation-en                 
Ign http://stat.ethz.ch trusty/ Translation-en_US                   
Ign http://archive.canonical.com trusty/partner Translation-en
Ign http://stat.ethz.ch trusty/ Translation-en
Ign https://private-ppa.launchpad.net precise/main Translation-en_US
Ign https://private-ppa.launchpad.net precise/main Translation-en
Fetched 490 B in 6s (78 B/s)                                                   
Reading package lists... Done
W: GPG error: http://stat.ethz.ch trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
1个回答

请查看README文件

SECURE APT

The Ubuntu archives on CRAN are signed with the key of "Michael Rutter <...@....com>" with key ID E084DAB9. To add the key to your system with one command use (thanks to Brett Presnell for the tip):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

An alternate method can be used by retrieving the key with

gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9

and then feed it to apt-key with

gpg -a --export E084DAB9 | sudo apt-key add -

谢谢!不运行您回复中的命令会有什么危害呢?我还能正确地更新和升级吗? - Tim
是的,它会更新,但没有建立起可信任的链条。 - rcs
谢谢。你知道我在这里的问题的答案吗?http://askubuntu.com/questions/610537/error-adding-a-repository-to-etc-apt-sources-list 我不知道应该跟随其中的哪一个回复。 - Tim
请同时解决此问题,方法如下:sudo apt-get update 2>&1 |
grep NO_PUBKEY |
sed -e 's?^.*NO_PUBKEY ??' |
while read _hash; do
wget -O- "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${_hash}" |
sudo apt-key add -; done
- Michael Mikowski
1如果您无法检索到密钥服务器(由防火墙阻止),请参阅https://unix.stackexchange.com/questions/75892/keyserver-timed-out-when-trying-to-add-a-gpg-public-key - ismailsunni