8
E: Failed to fetch http://mirrors.kali.com/kali/dists/kali-rolling/main/binary-i386/Packages.gz  File has unexpected size (15320738 != 15317336). Mirror sync in progress? [IP: 111.11.111.111 80]
   Hashes of expected file:
    - Filesize:15317336 [weak]
    - SHA256:c4762e83455984f8d3fb54f6f42836808b8c891ba117661b61240bc5774d2e02
    - SHA1:fdebd56e7541e6f88d7910988ef694d3c409e21d [weak]
    - MD5Sum:51400b889af8677132f31d56f266bf22 [weak]
   Release file created at: Fri, 06 Oct 2017 06:55:45 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

this is the error page.How to deal with this problem?

Adam Katz
  • 14,455
  • 5
  • 68
  • 83

4 Answers4

9

I had the same problem. Here is my solution and it works on Kali inside VirtualBox.

Please update your /etc/apt/sources.list with

deb https://http.kali.org/kali kali-rolling main non-free contrib

Example

root@kali:~# cat /etc/apt/sources.list
deb https://http.kali.org/kali kali-rolling main non-free contrib
# deb-src https://http.kali.org/kali kali-rolling main non-free contrib
root@kali:~#

Let's update it ...

root@kali:~# apt update
Hit:1 https://archive-3.kali.org/kali kali-rolling InRelease
Reading package lists... Done
root@kali:~#

Hope this helps.

2

I've resolved it. It seems that you added more than one source entries in /etc/apt/sources.list. I guess more than one entry will make apt command confused, likely get header from one source then get packages from another, and the package size may not equal to the one defined in header. Edit the file and left only one source entry worked for me. Hope this helpful

monk
  • 228
  • 2
  • 10
2

Check if the firewall is blocking it. For me it was the firewall detecting the packets as malicious.

MistSpark
  • 66
  • 2
  • Thanks for this, my Sophos UTM's default settings for web filtering were blocking this traffic as potentially malicious. – Robbie Crash Dec 29 '17 at 23:41
-3

First open the file /etc/apt/sources.list, then delete all lines and add those lines

deb http://repo.kali.org/kali kali-rolling main non-free contrib
deb-src http://repo.kali.org/kali kali-rolling main non-free contrib

save and execute again

sudo apt-get update
  • 2
    This leads to an error after `sudo apt-get update`: `root@kali:~# apt-get update Err:1 http://repo.kali.org/kali kali-rolling InRelease 403 Forbidden [IP: 144.217.77.182 80] Reading package lists... Done E: Failed to fetch http://repo.kali.org/kali/dists/kali-rolling/InRelease 403 Forbidden [IP: 144.217.77.182 80] E: The repository 'http://repo.kali.org/kali kali-rolling InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.` – HorstKevin Apr 06 '18 at 09:57