Kali Linux - apt 更新返回“哈希和不匹配”

Kali Linux - apt 更新返回“哈希和不匹配”

我最近在虚拟机上安装了 Kali Linux 并决定运行apt update.每次我尝试时,我都会遇到这个可怕的错误。

Get:1 https://kali.download/kali kali-rolling InRelease [30.5 kB]
Get:2 https://kali.download/kali kali-rolling/main amd64 Packages [16.5 MB]
Err:2 https://kali.download/kali kali-rolling/main amd64 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:16520977 [weak]
   - SHA256:f01529c6d3e3259775f052b84a336ad9aa0a02156751b1edb28cb7cc635a46d6
   - SHA1:8cb85fa99d2cf0bccacb68c65dba8b043070e4cf [weak]
   - MD5Sum:92b1c6a2e788e13acc678a3173a4c653 [weak]
  Hashes of received file:
   - SHA256:f07b7c964b1e75b1e60fb1c5bb9b24eddcc39055ef81cf0578311a4ce9b2d786
   - SHA1:77c969f7b2e45cfb9c1b36ccd3971f28ca202312 [weak]
   - MD5Sum:d7f99187e8a2eb6c482a005ef7c12230 [weak]
   - Filesize:16520977 [weak]
  Last modification reported: Fri, 14 Aug 2020 12:02:10 +0000
  Release file created at: Fri, 14 Aug 2020 12:03:05 +0000
Get:3 https://kali.download/kali kali-rolling/non-free amd64 Packages [197 kB]
Get:4 https://kali.download/kali kali-rolling/contrib amd64 Packages [102 kB]
Fetched 16.6 MB in 2s (8,704 kB/s)
Reading package lists... Done
E: Failed to fetch https://kali.download/kali/dists/kali-rolling/main/binary-amd64/Packages.gz  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:16520977 [weak]
    - SHA256:f01529c6d3e3259775f052b84a336ad9aa0a02156751b1edb28cb7cc635a46d6
    - SHA1:8cb85fa99d2cf0bccacb68c65dba8b043070e4cf [weak]
    - MD5Sum:92b1c6a2e788e13acc678a3173a4c653 [weak]
   Hashes of received file:
    - SHA256:f07b7c964b1e75b1e60fb1c5bb9b24eddcc39055ef81cf0578311a4ce9b2d786
    - SHA1:77c969f7b2e45cfb9c1b36ccd3971f28ca202312 [weak]
    - MD5Sum:d7f99187e8a2eb6c482a005ef7c12230 [weak]
    - Filesize:16520977 [weak]
   Last modification reported: Fri, 14 Aug 2020 12:02:10 +0000
   Release file created at: Fri, 14 Aug 2020 12:03:05 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

经过一番谷歌搜索后,我发现另外两个人和我有同样的问题。

Kali Linux:apt-get 更新返回“哈希和不匹配”错误

https://forums.kali.org/showthread.php?32585-update-error-Hash-Sum-mismatch

两者都有相同的解决方案,看起来很有希望。

不幸的是,即使在编辑后/etc/apt/sources.list使用其他镜像http://mirror.anquan.cl/kali我仍然遇到同样的错误。

编辑(澄清):我在网上找到的解决方案,上面的链接,都说要更改 /etc/apt/sources.list 中使用的镜像,这对我不起作用。

答案1

尝试使用另一个镜子官方镜像列表 并将其添加到/etc/apt/sources.list.

喜欢:

deb http://mirrors.ocf.berkeley.edu/kali kali-rolling 主要非自由贡献

答案2

经过几个小时的谷歌搜索后,我发现这篇文章比我能更好地解释这个问题。

Kali Linux:apt 更新返回“哈希和不匹配”错误

解决方法是:

1:关闭Kali虚拟机

2:以管理员身份打开cmd

3:运行bcdedit /set hypervisorlaunchtype off

4:只需重新启动即可

答案3

对于那些无法禁用 hyper-v 的人,因为他们必须同时运行 Docker,那么我很幸运地使用了“Kali Linux 32 位(PAE)VirtualBox”。那里没有校验和错误。

答案4

我遇到了同样的问题,这为我解决了:

mkdir /etc/gcrypt
echo all >> /etc/gcrypt/hwf.deny
apt update

来源

相关内容