我正在使用 ubuntu 18.04。当我尝试使用 更新软件时sudo apt update && sudo apt upgrade
,出现校验和不匹配错误:
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-headers-4.15.0-144 all 4.15.0-144.148 [11.0 MB]
Err:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-headers-4.15.0-144 all 4.15.0-144.148
Hash Sum mismatch
Hashes of expected file:
- SHA512:ab631e944879a603bce23fd40b9a959eb567e0e27b7c2ab34f7eff5c1722b3fed1747123f1682635d825a61a9ef070067330008a4134394d95fe2832cdf80882
- SHA256:8bca25a9b8d9ef5c43b94dbd8e4aec36f77d7617cf524e1d8e89e4429927d383
- SHA1:c15a145876ad7e6059fc24b86d8b7273a160c415 [weak]
- MD5Sum:8f50bc4934fc62ba526f1d75244e0727 [weak]
- Filesize:10956636 [weak]
Hashes of received file:
- SHA512:155fe310a3c19ba653d69e8bf797739ac27d9fc1a5cf140682dec7652c35c0af08b703e9c474f63500e9a7b44f6e3de4086caf7301cbae9cc8fe238fabfe3caa
- SHA256:70985c1b1f8fb1013e6912a3e3ac7580ddb878f42f962c9328dbd99e8b633e68
- SHA1:e05ac0266a1b6349489456caa234ae61cf69e315 [weak]
- MD5Sum:98de1c987d3726787cd89cc6a45450ba [weak]
- Filesize:10956636 [weak]
Last modification reported: Thu, 13 May 2021 09:11:42 +0000
Fetched 11.0 MB in 5s (2,418 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-4.15.0-144_4.15.0-144.148_all.deb Hash Sum mismatch
Hashes of expected file:
- SHA512:ab631e944879a603bce23fd40b9a959eb567e0e27b7c2ab34f7eff5c1722b3fed1747123f1682635d825a61a9ef070067330008a4134394d95fe2832cdf80882
- SHA256:8bca25a9b8d9ef5c43b94dbd8e4aec36f77d7617cf524e1d8e89e4429927d383
- SHA1:c15a145876ad7e6059fc24b86d8b7273a160c415 [weak]
- MD5Sum:8f50bc4934fc62ba526f1d75244e0727 [weak]
- Filesize:10956636 [weak]
Hashes of received file:
- SHA512:155fe310a3c19ba653d69e8bf797739ac27d9fc1a5cf140682dec7652c35c0af08b703e9c474f63500e9a7b44f6e3de4086caf7301cbae9cc8fe238fabfe3caa
- SHA256:70985c1b1f8fb1013e6912a3e3ac7580ddb878f42f962c9328dbd99e8b633e68
- SHA1:e05ac0266a1b6349489456caa234ae61cf69e315 [weak]
- MD5Sum:98de1c987d3726787cd89cc6a45450ba [weak]
- Filesize:10956636 [weak]
Last modification reported: Thu, 13 May 2021 09:11:42 +0000
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我很好奇,想知道造成这种情况的根本原因是什么。有没有关于如何解决这个问题的建议?
更新: 我尝试了有关清除缓存、更改镜像等的建议由于“哈希值不匹配”错误,无法下载软件包列表,但他们没有帮助。
为了确认文件的校验和,我尝试了一下,结果打印出 98de1c987d3726787cd89cc6a45450ba,与升级错误消息中提到的wget http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-4.15.0-144_4.15.0-144.148_all.deb && md5sum linux-headers-4.15.0-144_4.15.0-144.148_all.deb
校验和不同,8f50bc4934fc62ba526f1d75244e0727
https://www.ubuntuupdates.org/package/core/bionic/main/security/linux-headers-4.15.0-144。为什么校验和会改变?发布后,仓库上的软件包文件可以替换吗?
答案1
从官方仓库下载的软件包似乎已损坏。我尝试手动安装它,但dpkg -i linux-headers-4.15.0-144_4.15.0-144.148_all.deb
出现无法解压软件包的错误。
我把下载源改成了亚利桑那大学镜子升级之后就成功了。其他一些镜像也可以正常工作。