Raphael_W

[转载]Ubuntu的软件源更新常见问题及解决

最近家里的网可能被天朝了,一直很好用的更新设置,出现各种错误,但在公司可以,所以应该是网络的问题,所以把遇到的问题整理了一下:

问题一:

执行命令

sudo apt-get update

错误描述如下:

1 W: Failed to fetch http://mirrors.sohu.com/ubuntu/dists/precise/universe/i18n/Index  No Hash entry in Release file /var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise_universe_i18n_Index
2 W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages  Hash Sum mismatch
3 W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash Sum mismatch
4 E: Some index files failed to download. They have been ignored, or old ones used instead.

 

解决方法:

将/var/lib/apt/lists/partial/下的所有文件删除,但是这可以解决大部分问题,个别源不能解决,如"/var/lib /apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary- i386_Packages",无耐进入/var/lib/apt/lists/将对应的文件删除

 

问题二:

无法找到对应的KEY

1 W: GPG error: http://mirrors.sohu.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
2 W: GPG error: http://mirrors.sohu.com precise-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
3 W: GPG error: http://mirrors.sohu.com precise-proposed Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
4 W: GPG error: http://archive.canonical.com precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
5 W: GPG error: http://security.ubuntu.com precise-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

 

解决方法:

使用如下命令:

 
1 gpg --keyserver subkeys.pgp.net --recv-keys 40976EAF437D05B5
2 gpg -a --export 40976EAF437D05B5 | sudo apt-key add -

 

 

参考网站:

http://wiki.debian.org/SecureApt

posted on 2013-08-17 22:55  Raphael_W  阅读(246)  评论(0)    收藏  举报

导航