日期:2014-05-16  浏览次数:20747 次

更新linux时候提示无法“由于没有公钥,无法验证下列签名 ***”的解决方案

新安装的Ubuntu在使用sudo apt-get update更新源码的时候出现如下错误:

W: GPG 错误:http://ppa.launchpad.net precise Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3EE66BD3F599ACE3
W: GPG 错误:http://ppa.launchpad.net precise Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY 6AF0E1940624A220
W: 无法下载 bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash 校验和不符

W: 无法下载 bzip2:/var/lib/apt/lists/partial/mirrors.163.com_ubuntu_dists_precise-security_main_binary-i386_Packages  Hash 校验和不符

W: 无法下载 bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-amd64_Packages  Hash 校验和不符

W: 无法下载 bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash 校验和不符

E: Some index files failed to download. They have been ignored, or old ones used instead.

解决方法很简单,下载导入公钥就行,下载导入key的命令如下:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220 #此处6AF0E1940624A220需要是错误提示的key

此时继续更新发现没有公钥错误提示,但是还是效验存在问题,此时需要打开软件源的界面,将其他软件选项中的Canpnical合作伙伴/独立等四个选项取消勾选,再执行sudo apt-get update



此时发现可以顺利更新了。

sanbo@ubuntu:~/dev$ sudo apt-get update
命中 http://mirrors.163.com precise Release.gpg
命中 http://mirrors.163.com precise-updates Release.gpg                 
命中 http://mirrors.163.com precise-security Release.gpg                
命中 http://mirrors.163.com precise Release                             
命中 http://mirrors.163.com precise-updates Release                                            
命中 http://mirrors.163.com precise-security Release                                           
命中 http://mirrors.163.com precise/main Sources                                               
命中 http://mirrors.163.com precise/restricted Sources                                         
命中 http://mirrors.163.com precise/universe Sources                                           
命中 http://mirrors.163.com precise/multiverse Sources                                         
命中 http://mirrors.163.com precise/main amd64 Packages                                        
命中 http://mirrors.163.com precise/restricted amd64 Packages                                  
命中 http://mirrors.163.com precise/universe amd64 Packages             
命中 http://mirrors.163.com precise/multiverse amd64 Packages
命中 http://mirrors.163.com precise/main i386 Packages
命中 http://mirrors.163.com precise/restricted i386 Packages
命中 http://mirrors.163.com precise/universe i386 Packages
命中 http://mirrors.163.com precise/multiverse i386 Packages
命中 http://mirrors.163.com precise/main TranslationIndex
命中 http://mirrors.163.com precise/multiverse TranslationIndex
命中 http://mirrors.163.com precise/restricted TranslationIndex
命中 http://mirrors.163.com precise/universe TranslationIndex
命中 http://mirrors.163.com precise-updates/main Sources
命中 http://mirrors.163.com precise-updates/restricted Sources
命中 http://mirrors.163.com precise-updates/universe Sources
命中 http://mirrors.163.com precise-updates/multiverse Sources
命中 http://mirrors.163.com precise-updates/main amd64 Packages
命中 http://mirrors.163.com precise-updates/restricted amd64 Packages
命中 http://mirrors.163.com precise-updates/universe amd64 Packages
命中 http://mirrors.163.com precise-updates/multiverse amd64 Packages
命中 http://mirrors.163.com precise-updates/main i386 Packages
命中 http://mirrors.163.com precise-updates/restricted i386 Packages
命中 http://mirrors.163.com precise-updates/universe i386 Packages
命中 http://mirrors.163.com precise-updates/multiverse i386 Packages
命中 ht