更新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
命中 http://mirrors.163.com precise-updates/main TranslationIndex
命中 http://mirrors.163.com precise-updates/multiverse TranslationIndex
命中 http://mirrors.163.com precise-updates/restricted TranslationIndex
命中 http://mirrors.163.com precise-updates/universe TranslationIndex
命中 http://mirrors.163.com precise-security/main Sources
命中 http://mirrors.163.com precise-security/restricted Sources
命中 http://mirrors.163.com precise-security/universe Sources
命中 http://mirrors.163.com precise-security/multiverse Sources
命中 http://mirrors.163.com precise-security/main amd64 Packages
命中 http://mirrors.163.com precise-security/restricted amd64 Packages
命中 http://mirrors.163.com precise-security/universe amd64 Packages
命中 http://mirrors.163.com precise-security/multiverse amd64 Packages
命中 http://ppa.launchpad.net precise Release.gpg
命中 http://ppa.launchpad.net precise Release.gpg
命中 http://mirrors.163.com precise-security/main i386 Packages
命中 http://mirrors.163.com precise-security/restricted i386 Packages
命中 http://mirrors.163.com precise-security/universe i386 Packages
命中 http://mirrors.163.com precise-security/multiverse i386 Packages
命中 http://mirrors.163.com precise-security/main TranslationIndex
命中 http://mirrors.163.com precise-security/multiverse TranslationIndex
命中 http://mirrors.163.com precise-security/restricted TranslationIndex
命中 http://mirrors.163.com precise-security/universe TranslationIndex
获取:1 http://mirrors.163.com precise/main Translation-zh_CN [100 kB]
命中 http://mirrors.163.com precise/main Translation-en    
获取:2 http://mirrors.163.com precise/multiverse Translation-zh_CN [6,476 B]
命中 http://mirrors.163.com precise/multiverse Translation-en
获取:3 http://mirrors.163.com precise/restricted Translation-zh_CN [2,620 B]
命中 http://mirrors.163.com precise/restricted Translation-en
获取:4 http://mirrors.163.com precise/universe Translation-zh_CN [139 kB]
命中 http://ppa.launchpad.net precise Release                                                    
命中 http://mirrors.163.com precise/universe Translation-en                             
获取:5 http://mirrors.163.com precise-updates/main Translation-zh_CN [100 kB]
命中 http://mirrors.163.com precise-updates/main Translation-en                                 
获取:6 http://mirrors.163.com precise-updates/multiverse Translation-zh_CN [6,476 B]
命中 http://mirrors.163.com precise-updates/multiverse Translation-en                        
获取:7 http://mirrors.163.com precise-updates/restricted Translation-zh_CN [2,620 B]
命中 http://mirrors.163.com precise-updates/restricted Translation-en                               
获取:8 http://mirrors.163.com precise-updates/universe Translation-zh_CN [139 kB]
命中 http://mirrors.163.com precise-updates/universe Translation-en                              
命中 http://mirrors.163.com precise-security/main Translation-en
命中 http://mirrors.163.com precise-security/multiverse Translation-en
命中 http://mirrors.163.com precise-security/restricted Translation-en
命中 http://mirrors.163.com precise-security/universe Translation-en
命中 http://ppa.launchpad.net precise Release            
命中 http://ppa.launchpad.net precise/main Sources
命中 http://ppa.launchpad.net precise/main amd64 Packages
命中 http://ppa.launchpad.net precise/main i386 Packages
忽略 http://ppa.launchpad.net precise/main TranslationIndex
命中 http://ppa.launchpad.net precise/main Sources
命中 http://ppa.launchpad.net precise/main amd64 Packages
命中 http://ppa.launchpad.net precise/main i386 Packages
忽略 http://ppa.launchpad.net precise/main TranslationIndex
忽略 http://ppa.launchpad.net precise/main Translation-zh_CN                                                                                                     
忽略 http://ppa.launchpad.net precise/main Translation-zh                                                                                                        
忽略 http://ppa.launchpad.net precise/main Translation-en_US                                                                                                     
忽略 http://ppa.launchpad.net precise/main Translation-en                                                                                                        
忽略 http://ppa.launchpad.net precise/main Translation-zh_CN                                                                                                     
忽略 http://ppa.launchpad.net precise/main Translation-zh                                                                                                        
忽略 http://ppa.launchpad.net precise/main Translation-en_US                                                                                                     
忽略 http://ppa.launchpad.net precise/main Translation-en                                                                                                        
下载 497 kB,耗时 7秒 (66.3 kB/s)                                                                                                                                
正在读取软件包列表... 完成


搞定收工!

另外送上一个163源,更新的速度挺不错,品种也挺全的:

# deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release i386 (20120817.3)]/ precise main restricted
   
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.163.com/ubuntu/ precise main restricted
deb-src http://mirrors.163.com/ubuntu/ precise main restricted
   
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
   
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
   
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
   
deb http://mirrors.163.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
deb http://mirrors.163.com/ubuntu/ precise-security universe
deb-src http://mirrors.163.com/ubuntu/ precise-security universe
deb http://mirrors.163.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
   
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner
   
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
   
# codeblock 
deb http://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/pasgui/ppa/ubuntu precise main
   
# ubuntu tweak
deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main



==============================================偶尔时刻还是有各种问题,归纳如下================================================

 【缺少公钥】

现象:

sudo apt-get update
W: GPG error: http://apt.tt-solutions.com dapper Release: 由于没有公钥,下列签名无法进行验证: NO_PUBKEY 06EA41DE4F6C1E86

解决方法:

gpg --keyserver subkeys.pgp.net --recv 4F6C1E86
gpg --export --armor 4F6C1E86 | sudo apt-key add -

说明:
若缺少其他公钥,则将命令中两处4F6C1E86改为NO_PUBKEY
06EA41DE4F6C1E86中最后8位即可!

如果是Ubuntu PPA的则按照如下方法处理:

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


【签名错解决办法】

情况一.概率出现的问题,这次有,可能下次就没了,可忽略

By simply waiting. This happens at times during archive updates.

情况二.使用如下方法更新:

$ sudo apt-get update -o Acquire::http::No-Cache=True
或者
$ sudo apt-get update -o Acquire::BrokenProxy=true
情况三.
现象:

In a particular case this was caused by a broken file and could get fixed using rescue boot and "fsck -fy /" (http://forum.ubuntuusers.de/goto?post=89197 - german)

解决办法:

fsck -fy /

情况四:

现象:

The fix is just to back up sources.list, delete everything in it and run "apt-get update". After the update replace sources.list with the backup and run "apt-get update" again. You should not get the error then.
解决办法:

备份sources.list,然后把sources.list中的东西删空,运行"apt-get update",然后再用刚刚的备份将"apt-get update"复原,再运行"apt-get update"。


情况五.主旨就是清理缓存

sudo bash

apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update

情况六.缓存代理服务器导致的问题:

如下内容添加到/etc/apt/apt.conf.d/10broken_proxy文件里试试看。

Acquire::http::No-Cache "true";
Acquire::http::Max-Age "0";

情况七

sudo apt-get install medibuntu-keyring

阅读更多

没有更多推荐了,返回首页