Kali Linux – apt-get Update Returns ‘Hash Sum Mismatch’ Error

kali-linux

I've just downloaded Kali Linux here.

https://images.offensive-security.com/virtual-images/Kali-Linux-2017.1-vbox-i686.ova

root@kali:~# uname -a
Linux kali 4.9.0-kali3-686-pae #1 SMP Debian 4.9.18-1kali1 (2017-04-04) i686 GNU/Linux
root@kali:~# 

However, when I try to update it, I'm getting "Hash Sum mismatch" error.

I've found similar issue here, but no solution provided.

This happens when you try and use a mirror thats sync'ing up. Just
need to wait it out.

root@kali:~# apt-get clean && apt-get update  
Get:1 http://ftp.yzu.edu.tw/Linux/kali kali-rolling InRelease [30.5 kB]
Get:2 http://58.27.38.18/ftp.yzu.edu.tw/Linux/kali kali-rolling/main i386 Packages [15.4 MB]
Err:2 http://58.27.38.18/ftp.yzu.edu.tw/Linux/kali kali-rolling/main i386 Packages                                                                                
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:15369822 [weak]
   - SHA256:96c0762f0939a8231227c72b37c38c5aa7e1e8d9df391c541e004785f235668d
   - SHA1:5b6fb42e4ab12227637bcca0505f0ed7185367af [weak]
   - MD5Sum:a9100c40be793e8887d3ceef98a39eea [weak]
  Hashes of received file:
   - SHA256:2d9eb600d3e43657577de559057912d16b643674437e2211a0785f58a621f38c
   - SHA1:6398050676d6b9de57807edb20c102210de03c01 [weak]
   - MD5Sum:8a5e5d7ecd4151676a9b6605627b1f86 [weak]
   - Filesize:15367961 [weak]
  Last modification reported: Fri, 28 Jul 2017 00:04:07 +0000
  Release file created at: Sat, 29 Jul 2017 12:07:34 +0000
Get:3 http://58.27.38.18/ftp.yzu.edu.tw/Linux/kali kali-rolling/non-free i386 Packages [146 kB]                                                                   
Get:4 http://58.27.38.18/ftp.yzu.edu.tw/Linux/kali kali-rolling/contrib i386 Packages [101 kB]                                                                    
Fetched 15.6 MB in 14s (1,067 kB/s)                                                                                                                               
Reading package lists... Done
E: Failed to fetch http://58.27.38.18/ftp.yzu.edu.tw/Linux/kali/dists/kali-rolling/main/binary-i386/Packages.gz  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:15369822 [weak]
    - SHA256:96c0762f0939a8231227c72b37c38c5aa7e1e8d9df391c541e004785f235668d
    - SHA1:5b6fb42e4ab12227637bcca0505f0ed7185367af [weak]
    - MD5Sum:a9100c40be793e8887d3ceef98a39eea [weak]
   Hashes of received file:
    - SHA256:2d9eb600d3e43657577de559057912d16b643674437e2211a0785f58a621f38c
    - SHA1:6398050676d6b9de57807edb20c102210de03c01 [weak]
    - MD5Sum:8a5e5d7ecd4151676a9b6605627b1f86 [weak]
    - Filesize:15367961 [weak]
   Last modification reported: Fri, 28 Jul 2017 00:04:07 +0000
   Release file created at: Sat, 29 Jul 2017 12:07:34 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@kali:~#

This is my sources.list file

root@kali:~# cat /etc/apt/sources.list
# 

# deb cdrom:[Debian GNU/Linux 2017.1 _Kali-rolling_ - Official Snapshot i386 LIVE/INSTALL Binary 20170416-07:26]/ kali-rolling contrib main non-free

#deb cdrom:[Debian GNU/Linux 2017.1 _Kali-rolling_ - Official Snapshot i386 LIVE/INSTALL Binary 20170416-07:26]/ kali-rolling contrib main non-free

deb http://http.kali.org/kali kali-rolling main non-free contrib
# deb-src http://http.kali.org/kali kali-rolling main non-free contrib
root@kali:~# 

Any idea how to fix this?

Best Answer

Try using another mirror from the official mirror list and add it to /etc/apt/sources.list.

Like:

deb http://mirrors.ocf.berkeley.edu/kali kali-rolling main non-free contrib
Related Question