Hash Sum mismatch Ubuntu Server 18.04.1 LTS

Bug #1785778 reported by Sundar Shrestha
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi,
I'm getting weird Hashes mismatch error while trying to update Ubuntu server 18.04.1 LTS server. The error I'm receiving is as follows.

$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/universe Sources [52.2 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main Sources [152 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Sources [2,676 B]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [277 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [105 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [157 kB]
Err:10 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:157408 [weak]
   - SHA256:95fae016beb34455d4601a44c76d1823479178cbcdc58365750d4c039eecfb18
   - SHA1:ad29965fe436d84b62331a4662e5fc679103fa0d [weak]
   - MD5Sum:4375646a0495b45597e06fb3e21dbd10 [weak]
  Hashes of received file:
   - SHA256:cdb9774bad7ab6f191ce597e3139f105477428fdc2509c63fcac8e5b904e4f4a
   - SHA1:96a041a735ddb8be1b14cc214ce0f56b486b42db [weak]
   - MD5Sum:a33f0341357c0be32207618a14b500db [weak]
   - Filesize:157408 [weak]
  Last modification reported: Tue, 07 Aug 2018 07:15:09 +0000
  Release file created at: Tue, 07 Aug 2018 07:15:03 +0000
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [71.0 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [3,772 B]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [2,376 B]
Err:14 http://download.webmin.com/download/repository sarge InRelease
  Could not connect to download.webmin.com:80 (108.60.199.109), connection timed out
Fetched 329 kB in 30s (10.9 kB/s)
Reading package lists... Done
W: Failed to fetch http://download.webmin.com/download/repository/dists/sarge/InRelease Could not connect to download.webmin.com:80 (108.60.199.109), connection timed out
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/binary-amd64/by-hash/SHA256/95fae016beb34455d4601a44c76d1823479178cbcdc58365750d4c039eecfb18 Hash Sum mismatch
   Hashes of expected file:
    - Filesize:157408 [weak]
    - SHA256:95fae016beb34455d4601a44c76d1823479178cbcdc58365750d4c039eecfb18
    - SHA1:ad29965fe436d84b62331a4662e5fc679103fa0d [weak]
    - MD5Sum:4375646a0495b45597e06fb3e21dbd10 [weak]
   Hashes of received file:
    - SHA256:cdb9774bad7ab6f191ce597e3139f105477428fdc2509c63fcac8e5b904e4f4a
    - SHA1:96a041a735ddb8be1b14cc214ce0f56b486b42db [weak]
    - MD5Sum:a33f0341357c0be32207618a14b500db [weak]
    - Filesize:157408 [weak]
   Last modification reported: Tue, 07 Aug 2018 07:15:09 +0000
   Release file created at: Tue, 07 Aug 2018 07:15:03 +0000
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have tried solution provided in search as "removing all files in /var/lib/apt/lists and update again" but it doesn't work. Don't know how to resolve it.

Revision history for this message
Sundar Shrestha (sundar-shrestha-001) wrote :

I found similar error in new installation also. I notice the mismatch error occurs when updating Kernel version 4.15.0-30-generic. Before 4.15.0-30-generic version apt-get update works like charm but afterward it failed for updates universe repository.

description: updated
tags: added: mismatch
removed: mistach
summary: - Hash Sum mismatch
+ Hash Sum mismatch Ubuntu Server 18.04.1 LTS
description: updated
affects: ubuntu-release-upgrader (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Julian Andres Klode (juliank) wrote :

Closing this, as the file in question no longer exists. If you can reproduce it, please reopen and/or comment with a new output so we see the file that files. Also try to download the failing URL and calculcate the sha256 manually and check if it matches.

Usually a failure like that indicates a broken ISP that mangles your traffic.

Changed in apt (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
M. Haag (mahaag) wrote :

We also recognized this issue on two laptops and downloaded one package which should be updated with wget manually:

$ md5sum firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb*
1577ff1303d995196bf47362feef7e5f firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb
ca062374dadbe009bda1bc4ae49d29cb firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.1
216ff072772aad7c442158d341cc0882 firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.2

=> Every time a different content!

So I changed the network cable from the Thunderbolt dock to the internal network adapter and now it works:

$ md5sum firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb*
1577ff1303d995196bf47362feef7e5f firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb
ca062374dadbe009bda1bc4ae49d29cb firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.1
216ff072772aad7c442158d341cc0882 firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.2
13a869e979b64bb8d0fefb0f8966b063 firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.3
13a869e979b64bb8d0fefb0f8966b063 firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.4
13a869e979b64bb8d0fefb0f8966b063 firefox_62.0+build2-0ubuntu0.18.04.4_amd64.deb.5

We are using kernel 4.15.0-34-generic with Dell Precision 7530 and TB18 dock. The wget finishes with exit code 0 and the size of the file is always the same.

Changed in apt (Ubuntu):
status: Invalid → New
Revision history for this message
M. Haag (mahaag) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

Matthias Haag (mahaag) wrote 1 hour ago:
> We also recognized this issue on two laptops and downloaded one package which should be updated with wget manually:
[...]
> => Every time a different content!

So apt successfully detected the failed content, therefore there is no bug in apt here.

Changed in apt (Ubuntu):
status: New → Invalid
Revision history for this message
Elzix (contemplator) wrote :

E: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 Hash Sum mismatch

I went to http://gb.archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/binary-amd64/by-hash/SHA256/ and downloaded 54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 2018-12-07 12:40 388K

$ sha256sum 54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462
50b11a2f079b77e21cf149c15f5bbc9d29fa3f32a9f4e886e51744738202a3fc 54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462

Tried switching server: http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462

and got the same hash 50b11a2f079b77e21cf149c15f5bbc9d29fa3f32a9f4e886e51744738202a3fc in error.

Revision history for this message
Elzix (contemplator) wrote :

File list has changed. Error no longer exists. Let it be noted that this error may recur.

Question: Does one just need to wait for refresh of files or report it here anyway?

Revision history for this message
Julian Andres Klode (juliank) wrote :

@Elzix: You might want to talk to your ISP, or check your hardware, as something is broken.

jak@jak-t480s:~:master$ curl -s http://gb.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 | sha256sum
54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 -
jak@jak-t480s:~:master$ curl -s http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 | sha256sum
54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 -
jak@jak-t480s:~:master$ curl -s http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 | sha256sum
54181e4ce10a58ed362cac0b1a98f48989710d6697291b81e0ad7a2c9320a462 -

Revision history for this message
Sundar Shrestha (sundar-shrestha-001) wrote :
Download full text (3.4 KiB)

Even by downloading the file and checking HASH and MD5sum. It's different than it should be. Can you please tell me how to what to ask for ISP if they are mangling the traffic.

HASH file downloaded and check for SHA256 checksum.

Get:15 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic/multiverse Translation-en [108 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [454 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [169 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [6,992 B]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [3,076 B]
Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [592 kB]
Err:21 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:592272 [weak]
   - SHA256:4d0d8e9333b6ffbd2f40ad77155823f8bc231b7a363c5fc901172a53819248b8
   - SHA1:e1db814ef58855914af89e6a64a29d14ee43b280 [weak]
   - MD5Sum:a6799ae06b4e4a977bc6ef98d1a64758 [weak]
  Hashes of received file:
   - SHA256:65b8bf8f415626588cd41c899159d8d3fff7a0b2d6deaf122f2066b9f5667f2d
   - SHA1:faade6528307e867d378a4faccc955627b6529d5 [weak]
   - MD5Sum:5dccc9ef9d9a1189787ace009a0ab8d0 [weak]
   - Filesize:592272 [weak]
  Last modification reported: Fri, 07 Dec 2018 12:40:08 +0000
  Release file created at: Fri, 07 Dec 2018 13:10:55 +0000
Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [165 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [6,372 B]
Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [3,356 B]
Get:25 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3,468 B]
Get:26 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [1,604 B]
Get:27 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [218 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-security/main Translation-en [84.0 kB]
Get:29 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [106 kB]
Get:30 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [60.3 kB]
Get:31 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [1,440 B]
Get:32 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [996 B]
Fetched 17.7 MB in 15s (1,162 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/binary-amd64/by-hash/SHA256/4d0d8e9333b6ffbd2f40ad77155823f8bc231b7a363c5fc901172a53819248b8 Hash Sum mismatch
   Hashes of expected file:
    - Filesize:592272 [weak]
    - SHA256:4d0d8e9333b6ffbd2f40ad77155823f8bc231b7a363c5fc901172a53819248b8
    - SHA1:e1db814ef58855914af89e6a64a29d14ee43b280 [weak]
    - MD5Sum:a6799ae06b4e4a977bc6ef98d1a64758 [weak]
   Hashes of received file:
    - SHA256:65b8bf8f415626588cd41c899159d8d3fff7a0b2d6deaf122f2066b9f5667f2d
    - SHA1:faade6528307e867d378a4faccc955627b6529d5 [weak]
    - M...

Read more...

Revision history for this message
vinay teki (1k3t) wrote :

I'm facing the exact same issue.
Did you find a solution @sundhar shrestha.
please let me know.

Revision history for this message
Pujan Mehta (pujanm) wrote :

I got a solution to this problem. Follow these steps:

1. sudo rm -rf /var/lib/apt/lists/*
2. sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
3. sudo apt-get update && sudo apt-get upgrade

Hope it helps!

Revision history for this message
shubham jain (war-l0ck) wrote :

@pujan Thanks, this fixed the issue for me

Revision history for this message
R. Oliveira (rodrigobrochado) wrote :

I've faced the same issue, but in a recently installed Ubuntu Desktop 18.04 on a Asus K46CB.
I tried @pujan fix but it didn't work.

Several minutes later I've tried to type: ~$ cat /etc/resolv.conf following tips from here (Brazilian forum):
https://www.vivaolinux.com.br/topico/Iniciantes-no-Linux/Update-no-Ubuntu-1604-LTS

This command input in that thread was in fact intended to see the DNS config, but just the execution of the command seems to solve the guy problem.

So I tried to input the same command and after I've (magically) also succeed to update the packages.

There are two possible misconceptions here:
- The kernel was already updating the packages because of the Ubuntu fresh install and apt in some way get confused;
- Or it was a communication/network/ISP problem that got fixed by itself.

As I didn't try to directly update the packages after the "several minutes" and type the cat command instead, it's not possible to know if it really was the cat command or the network that got fixed. Also it's kind of weird that the simple fact of checking a config file solve a problem, right? But it is kind of huge coincidence that two different computers in different years (2017 and 2019) got the same fix after that command, isn't it?

Revision history for this message
Matthew Joshua (mattexpertcalc2019) wrote :

Thanks @pujanm. Your method worked for me. I'm really grateful. Here's my e-mail, <email address hidden>.

Changed in apt (Ubuntu):
status: Invalid → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
Changed in apt (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Sencer HAMARAT (sencerhamarat) wrote :
Download full text (18.5 KiB)

Today I got same issue and @pujanm's suggestion is solved the problem.

# apt-get update
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
Get:3 https://repo.skype.com/deb stable InRelease [4.487 B]
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://archive.canonical.com/ubuntu bionic InRelease [10,2 kB]
Ign:6 http://repo.vivaldi.com/stable/deb stable InRelease
Get:7 http://dl.google.com/linux/chrome/deb stable Release [943 B]
Get:8 http://repo.vivaldi.com/stable/deb stable Release [3.831 B]
Get:9 http://repo.vivaldi.com/stable/deb stable Release.gpg [833 B]
Get:10 http://archive.canonical.com/ubuntu bionic/partner amd64 Packages [2.320 B]
Get:11 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]
Ign:13 http://packages.linuxmint.com tessa InRelease
Get:14 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [265 kB] ...

Revision history for this message
Sundar Shrestha (sundar-shrestha-001) wrote :

@Julian Andres,
Sorry for trouble. But I'm still getting HASH MISMATCH with apt-get update.
I don't know why but I think apt is downloading wrong file or repository has filename with wrong hash. I don't know if it's ISP traffic mangling.
I have downloaded file located in by-hash/sha256 and check hash online. The hash of file is different.

Here are the screen shot.

Changed in apt (Ubuntu):
status: Invalid → New
Changed in apt (Ubuntu):
status: New → Confirmed
status: Confirmed → New
Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
Sundar Shrestha (sundar-shrestha-001) wrote :

I can't installed ubuntu 18.04.x LTS release with error. of HASH SUM MISMATCH DURING INSTALLATION.
I have tried to install it 5 times. But same error in my machine.

Changed in apt (Ubuntu):
status: Confirmed → Won't Fix
status: Won't Fix → Invalid
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Tantely (neyall) wrote :

Thank you Bro! it's work very well for me

Revision history for this message
Aalaap Ghag (aalaap) wrote :

This randomly started happening on 18.04.3 on WSL, but @pujanm's fix did the trick!

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1785778/comments/11

Revision history for this message
Jeronimo (jscmenezes) wrote :

Tip #11 word for me! Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.