运行时哈希不匹配sudo apt update
。
sudo apt clean && sudo rm -rf /var/lib/apt/lists/*
这两个命令都不起作用,主服务器的每个镜像都会发生这种情况
错误信息在这里:-
E: Failed to fetch http://mirror.cse.iitk.ac.in/ubuntu/dists/focal-updates/main/binary-i386/by-hash/SHA256/016259cc5a05a24d9eaa7f7d2e72f00d5f4094c9cae52ab2f6914aa40ae9ec97 Hash Sum mismatch
Hashes of expected file:
- Filesize:203432 [weak]
- SHA256:016259cc5a05a24d9eaa7f7d2e72f00d5f4094c9cae52ab2f6914aa40ae9ec97
- SHA1:92c84628833d08e7fd4cab4fb6c60f0cb5526908 [weak]
- MD5Sum:bab37a523ab35365753f89ccb90a0bbb [weak]
Hashes of received file:
- SHA256:4c03123d14ede9726beca8dac893b54ef1abf221191a65eaaf40d9a39837d116
- SHA1:80fbcd190a8038c024e0534c6ee79073d203d73c [weak]
- MD5Sum:56fe008e11233dda4c8810189b542503 [weak]
- Filesize:203432 [weak]
Last modification reported: Thu, 03 Sep 2020 01:14:19 +0000
Release file created at: Thu, 03 Sep 2020 03:30:39 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
使用三个命令可以解决这个问题:-
sudo apt clean && sudo rm -rf /var/lib/apt/lists/* && sudo apt clean && sudo apt update -o Acquire::CompressionTypes::Order::=gz