如何修复 APT 错误“W:无法获取 [...] 哈希总和不匹配”?

如何修复 APT 错误“W:无法获取 [...] 哈希总和不匹配”?

我不知道到底发生了什么,重启后我收到很多崩溃消息,如果我打开 Firefox 或 Synaptic,它们就会崩溃。Synaptic 返回以下内容:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.
E: _cache->open() failed, please report.

然后顶部面板上出现了崩溃图标,并且出现了一些有关合并列表的错误。我谷歌了一下,找到了这个,但是sudo rm /var/lib/apt/lists/* -vf sudo apt-get update不起作用。为了能够在浏览器中工作,我删除了 中的所有文件/var/lib/apt/lists。如果我尝试sudo apt-get update,我会得到这个:

W: Failed to fetch gzip:/var/lib/apt/lists/partial/ua.archive.ubuntu.com_ubuntu_dists_raring_main_source_Sources Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/ua.archive.ubuntu.com_ubuntu_dists_raring_restricted_source_Sources Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/ua.archive.ubuntu.com_ubuntu_dists_raring_universe_source_Sources Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_raring-security_main_source_Sources Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_raring-security_universe_source_Sources Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-i386_Packages Hash Sum mismatch
W: Failed to fetch gzip:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_raring-security_universe_binary-i386_Packages Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

我不想重新安装系统。我该如何解决?谢谢。

那里有一些照片。我无法截屏,它崩溃了:照片 1 照片 2

答案1

问题在于您递归删除了/var/lib/apt/lists,这也删除了部分目录。因此,重新创建目录应该可以解决问题:

sudo mkdir -p /var/lib/apt/lists/partial
sudo chmod 755 /var/lib/apt/lists/partial

另外,您使用的镜像可能存在问题。请选择另一个镜像并再次更新。

答案2

对我来说,乌克兰服务器出了问题!切换到主服务器会自动解决问题。如果以上方法均无效,请尝试其他服务器。

相关内容