新安装的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_xyz