apt update -> hash sum mismatch

Asked by Christopher Doris

I have a fresh install of Lubuntu (20.04.1) inside of a Virtualbox, and am getting "hash sum mismatch" errors when trying to "sudo apt update".

I have tried anything I could find to fix this, like:
- "sudo apt update -o Acquire::CompressionTypes::Order::=gz"
- "sudo rm -R /var/lib/apt/lists/*"
- changing the mirror
- reinstalling the OS
- trying Ubuntu MATE instead
- waiting and trying again (I first tried this yesterday afternoon, about 20 hours ago)

What seems really weird is that often some but not all of the hashes match. In the output below at the bottom is an example where the SHA256 hash matches but the SHA1 hash does not. I just tried hashing these files myself (with sha256sum and sha1sum) and in fact the expected hashes are correct, and the "received" hashes are incorrect, suggesting apt is computing the hash incorrectly?

Full output:

$ sudo apt update -o Acquire::CompressionTypes::Order::=gz
Get:1 http://gb.archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu focal/main i386 Packages [930 kB]
Err:5 http://gb.archive.ubuntu.com/ubuntu focal/main i386 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:930115 [weak]
   - SHA256:91c5425929fae2bc2f85a710122d6af774af6d6a2bd40573554aeb080d47ffc1
   - SHA1:4be87f5e97f426d7d7267643f67b9a1018a4f29d [weak]
   - MD5Sum:e679bb85cc6715db4f4cf3ae23d5a8f9 [weak]
  Hashes of received file:
   - SHA256:e582611a7b739162e15bd1c3f8b32dc3a1616d074f3436bff22edbb79ea577d7
   - SHA1:a4ba8fc2cbc22376ee4b668db1b054092e528074 [weak]
   - MD5Sum:e679bb85cc6715db4f4cf3ae23d5a8f9 [weak]
   - Filesize:930115 [weak]
  Last modification reported: Thu, 23 Apr 2020 16:40:26 +0000
  Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
Get:6 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 Packages [1,275 kB]
Err:6 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Get:7 http://gb.archive.ubuntu.com/ubuntu focal/main Translation-en_GB [681 kB]
Err:7 http://gb.archive.ubuntu.com/ubuntu focal/main Translation-en_GB

Get:8 http://gb.archive.ubuntu.com/ubuntu focal/main Translation-en [709 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 DEP-11 Metadata [705 kB]
Err:9 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 DEP-11 Metadata

Get:10 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 48x48 Icons [98.4 kB]
Get:11 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 64x64 Icons [163 kB]
Err:11 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 64x64 Icons

Get:12 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 64x64@2 Icons [15.8 kB]
Get:13 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 128x128 Icons [367 kB]
Err:13 http://gb.archive.ubuntu.com/ubuntu focal/main DEP-11 128x128 Icons

Get:14 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata [29.5 kB]
Get:15 http://gb.archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:16 http://gb.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [262 kB]
Err:16 http://gb.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:261975 [weak]
   - SHA256:93d5a16584e289c5158d36a5d20a618697c6c81ba1df8f0a4b807d41c78555bc
   - SHA1:76f693a3ef28b4875b0c069d3938230087bb00b8 [weak]
   - MD5Sum:3fe886b04bb1d652f38a6a6994c26d5b [weak]
  Hashes of received file:
   - SHA256:0f399851ce477477720985a9e4d719edb990331308022d42d61dbda5999b16b6
   - SHA1:0a7641115a38b7b2531470b5b03b107234f41a6d [weak]
   - MD5Sum:3fe886b04bb1d652f38a6a6994c26d5b [weak]
   - Filesize:261975 [weak]
  Last modification reported: Fri, 11 Sep 2020 08:16:27 +0000
  Release file created at: Fri, 11 Sep 2020 08:16:12 +0000
Get:17 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [457 kB]
Err:17 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages

Get:18 http://gb.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [181 kB]
Get:19 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [282 kB]
Err:19 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata

Get:20 http://gb.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 48x48 Icons [48.9 kB]
Get:21 http://gb.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64 Icons [79.3 kB]
Get:22 http://gb.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64@2 Icons [29 B]
Get:23 http://gb.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 128x128 Icons [174 kB]
Get:24 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [8,968 B]
Get:25 http://gb.archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages [7,960 B]
Get:26 http://gb.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [45.7 kB]
Get:27 http://gb.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [231 kB]
Get:28 http://gb.archive.ubuntu.com/ubuntu focal-security/main i386 Packages [85.5 kB]
Get:29 http://gb.archive.ubuntu.com/ubuntu focal-security/main Translation-en [87.3 kB]
Err:27 http://gb.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:1192113 [weak]
   - SHA256:e00f482a28864c6d14ec01c2b1f5ea179a22ef7510f898c63847e1347dab7edf
   - SHA1:62ae823a142771709ef4aa05fe8a0a3dc8c7fcde [weak]
   - MD5Sum:d2ede6c07026b5a4f70b908927400414 [weak]
  Hashes of received file:
   - SHA256:e00f482a28864c6d14ec01c2b1f5ea179a22ef7510f898c63847e1347dab7edf
   - SHA1:dde14e26323d3f2f2fcce1550d0ead3ef98209fa [weak]
   - MD5Sum:d2ede6c07026b5a4f70b908927400414 [weak]
   - Filesize:1192113 [weak]
  Last modification reported: Wed, 09 Sep 2020 11:04:01 +0000
  Release file created at: Fri, 11 Sep 2020 08:15:59 +0000
Get:30 http://gb.archive.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [28.4 kB]
Get:31 http://gb.archive.ubuntu.com/ubuntu focal-security/main DEP-11 48x48 Icons [11.0 kB]
Get:32 http://gb.archive.ubuntu.com/ubuntu focal-security/main DEP-11 64x64 Icons [16.5 kB]
Get:33 http://gb.archive.ubuntu.com/ubuntu focal-security/main DEP-11 64x64@2 Icons [29 B]
Get:34 http://gb.archive.ubuntu.com/ubuntu focal-security/main DEP-11 128x128 Icons [40.2 kB]
Get:35 http://gb.archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [4,504 B]
Get:36 http://gb.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [45.4 kB]
Err:36 http://gb.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages

Get:37 http://gb.archive.ubuntu.com/ubuntu focal-security/restricted i386 Packages [7,960 B]
Get:38 http://gb.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [10.8 kB]
Get:39 http://gb.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [112 B]
Get:40 http://gb.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:41 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [3,195 B]
Get:42 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages [2,274 B]
Get:43 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [1,341 B]
Get:44 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,766 B]
Get:45 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 48x48 Icons [2,809 B]
Get:46 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64 Icons [3,944 B]
Get:47 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 64x64@2 Icons [29 B]
Get:48 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe DEP-11 128x128 Icons [6,807 B]
Get:49 http://gb.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B]
Get:50 http://gb.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 7,727 kB in 5s (1,654 kB/s)
Reading package lists... Done
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/binary-i386/by-hash/SHA256/91c5425929fae2bc2f85a710122d6af774af6d6a2bd40573554aeb080d47ffc1 Hash Sum mismatch
   Hashes of expected file:
    - Filesize:930115 [weak]
    - SHA256:91c5425929fae2bc2f85a710122d6af774af6d6a2bd40573554aeb080d47ffc1
    - SHA1:4be87f5e97f426d7d7267643f67b9a1018a4f29d [weak]
    - MD5Sum:e679bb85cc6715db4f4cf3ae23d5a8f9 [weak]
   Hashes of received file:
    - SHA256:e582611a7b739162e15bd1c3f8b32dc3a1616d074f3436bff22edbb79ea577d7
    - SHA1:a4ba8fc2cbc22376ee4b668db1b054092e528074 [weak]
    - MD5Sum:e679bb85cc6715db4f4cf3ae23d5a8f9 [weak]
    - Filesize:930115 [weak]
   Last modification reported: Thu, 23 Apr 2020 16:40:26 +0000
   Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/by-hash/SHA256/f25bb719a900d962a4df25cbb20f0a54a23d9f16c3fcdc4f4872ead131f5a604
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/i18n/by-hash/SHA256/103e0a44809889e2df92e5fe36df326c1370e3d57f66ddaa7c25d72c4279f71d
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/dep11/by-hash/SHA256/88ca4592ef3591141ba2b1ebb8f68f90a354a5aedb9bfa44de532e05c3dd09c3
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/dep11/by-hash/SHA256/9f4ffba2a05dc2fb76857d4b30ed55724fe6e2999341694f2b86940ab067a44b
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal/main/dep11/by-hash/SHA256/6a9cea993810430b487cf786d2c1fef12d589f61c61aaad13804c00b5d6bfeb1
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-i386/by-hash/SHA256/93d5a16584e289c5158d36a5d20a618697c6c81ba1df8f0a4b807d41c78555bc Hash Sum mismatch
   Hashes of expected file:
    - Filesize:261975 [weak]
    - SHA256:93d5a16584e289c5158d36a5d20a618697c6c81ba1df8f0a4b807d41c78555bc
    - SHA1:76f693a3ef28b4875b0c069d3938230087bb00b8 [weak]
    - MD5Sum:3fe886b04bb1d652f38a6a6994c26d5b [weak]
   Hashes of received file:
    - SHA256:0f399851ce477477720985a9e4d719edb990331308022d42d61dbda5999b16b6
    - SHA1:0a7641115a38b7b2531470b5b03b107234f41a6d [weak]
    - MD5Sum:3fe886b04bb1d652f38a6a6994c26d5b [weak]
    - Filesize:261975 [weak]
   Last modification reported: Fri, 11 Sep 2020 08:16:27 +0000
   Release file created at: Fri, 11 Sep 2020 08:16:12 +0000
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64/by-hash/SHA256/9466dc1e953abb8a7fae98a7dade308e491e89d6f36290aa5e60176ef77775cd
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal-updates/main/dep11/by-hash/SHA256/83773d3ead26348b1542f0b781c80449aa73fa82c0511df3bfcb99506a9e8ff9
E: Failed to fetch store:/var/lib/apt/lists/partial/gb.archive.ubuntu.com_ubuntu_dists_focal-security_main_binary-amd64_Packages.gz Hash Sum mismatch
   Hashes of expected file:
    - Filesize:1192113 [weak]
    - SHA256:e00f482a28864c6d14ec01c2b1f5ea179a22ef7510f898c63847e1347dab7edf
    - SHA1:62ae823a142771709ef4aa05fe8a0a3dc8c7fcde [weak]
    - MD5Sum:d2ede6c07026b5a4f70b908927400414 [weak]
   Hashes of received file:
    - SHA256:e00f482a28864c6d14ec01c2b1f5ea179a22ef7510f898c63847e1347dab7edf
    - SHA1:dde14e26323d3f2f2fcce1550d0ead3ef98209fa [weak]
    - MD5Sum:d2ede6c07026b5a4f70b908927400414 [weak]
    - Filesize:1192113 [weak]
   Last modification reported: Wed, 09 Sep 2020 11:04:01 +0000
   Release file created at: Fri, 11 Sep 2020 08:15:59 +0000
E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/focal-security/restricted/binary-amd64/by-hash/SHA256/cf3019186029caa5abf6ff2a7ac683eb7156f72b2aa5c612af8d09a222c9ac41
E: Some index files failed to download. They have been ignored, or old ones used instead.

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Chris Guiver (guiverc) said :
#1

As I suggested on IRC, try increasing the RAM allocated to the VM.

Revision history for this message
Kai Kasurinen (kai-kasurinen) said :
#2
Revision history for this message
Christopher Doris (cjdoris) said :
#3

Aha thanks, that bug appears to be the cause (I have WSL2 installed).

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.