Ubuntu的软件源更新常见问题及解决

前端之家收集整理的这篇文章主要介绍了Ubuntu的软件源更新常见问题及解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

问题一:

执行命令

sudo apt-get update

错误描述如下:

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

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages  Hash Sum mismatch

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/将对应的文件删除

@H_403_28@注:经过长时间的实践,这个解决方法不是万能的,最终解决方法还是FQ吧。

问题二:

无法找到对应的KEY

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
error: http://mirrors.sohu.com precise-updates Release: The following signatures couldn't be verified because the public key is 40976EAF437D05B5
error: http://mirrors.sohu.com precise-proposed Release: The following signatures couldn't be verified because the public key is 40976EAF437D05B5
error: http://archive.canonical.com precise Release: The following signatures couldn't be verified because the public key is 40976EAF437D05B5
error: http://security.ubuntu.com precise-security Release: The following signatures couldn't be verified because the public key is 40976EAF437D05B5

使用如下命令:

gpg --keyserver subkeys.pgp.net --recv-keys 40976EAF437D05B5
gpg -a --export 40976EAF437D05B5 | sudo apt-key add -
原文链接:https://www.f2er.com/ubuntu/350731.html

猜你在找的Ubuntu相关文章