xenial's amd64 sha256sum is invalid.

Asked by Tae-Young Kwon on 2018-11-05

I am using ubuntu 16.04 using the docker.
Hash Sum mismatch error has occurred from November 1st.

root:# docker pull ubuntu:16.04
16.04: Pulling from library/ubuntu
Digest: sha256:76702ec53c5e7771ba3f2c4f6152c3796c142af2b3cb1a02fce66c697db24f12
Status: Image is up to date for ubuntu:16.04
root:# docker run --rm -it ubuntu:16.04 /bin/bash
root@f638fc90ace5:/# apt-get update
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [732 kB]
Err:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
  Hash Sum mismatch
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [501 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3747 B]
Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1126 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [901 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [18.8 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [7965 B]
Get:18 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [8532 B]
Fetched 15.5 MB in 25s (612 kB/s)
Reading package lists... Done
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/by-hash/SHA256/1926e2729bc34fa9bfb48ec982549d1fe89e3d19258a9307fa7ecd8cf33a3b56 Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

I downloaded Packages.gz and Packages.xz from http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/.
The result of sha256sum is as follows.
root:# sha256sum Packages.*
16cf20cf8a1a762a5fe33d758ffb4743f41b5c2dc1d2a540c89ec65233baeeb4 Packages.gz
18e16c01aa4c6197bea580b96dae5ac3b51a2628f3c8b0a3ffe6a6045686e778 Packages.xz

But there is no 16cf20cf8a1a762a5fe33d758ffb4743f41b5c2dc1d2a540c89ec65233baeeb4 at http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/by-hash/SHA256/.
I do not know the detailed rules of that repository.
However, if you look at http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-i386/ there is sha256sum in all Packages.*.

Is there a Hash Sum mismatch error because of wrong sha256sum of http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/?

I'm sorry I do not have enough English. :(

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Tae-Young Kwon
Last query:
Last reply:

Run the below:

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt-get update
sudo apt-get dist-upgrade

This will clear the package knowledge and hashes and redownload it

Tae-Young Kwon (xoduddk123) said : #2

This seems to be a problem with ubuntu's package sha256sum.
The package was uploaded again on November 5th.
Of course, sha256sum has also been updated.
Now apt-get update will work normally.

Tae-Young Kwon (xoduddk123) said : #3

The issue has been resolved.