Errors in Kali Linux ‘W: Failed to fetch’ and ‘W: Some index files failed to download. They have been ignored, or old ones used instead.’ (SOLVED)

1. Cannot update Kali Linux because errors

A couple of people in recent days wrote about errors when updating programs in Kali Linux. An example of one of the errors:

Hit:1 kali-rolling InRelease         
Err:2 unstable InRelease   
  502  Connection timed out [IP: 80]
Reading package lists… Done
W: Failed to fetch  502  Connection timed out [IP: 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

An example of the second error:

W: Failed to fetch
Could not find IP address for ""

The very first thing you need to check if you encounter similar problems, is everything all right with your Internet connection – for example, open some web site.

If your Internet connection is alright, then continue. Let’s consider several examples of solving the problem.

2. Specifying a certain Kali Linux update mirror

When updating Kali Linux, a request is made to the host for a list of mirrors. The system then uses one of these mirrors to update. You can skip the stage of getting the list of mirrors (referring to, and hardcode the desired mirror in the repository sources file /etc/apt/sources.list.

The OFFICIAL Kali Linux repository mirror list is on this page:

On the territory of my country there is one mirror. In other countries, but on the same continent (EU), another 11 mirrors. And another 14 mirrors on other continents.

The mirror line looks like this:

Cut /README from this line and get the mirror address:

Open the /etc/apt/sources.list file:

sudo gedit /etc/apt/sources.list

And enter the mirror address there instead of the ellipsis deb … kali-rolling main non-free contrib, for example:

deb kali-rolling main non-free contrib

Now a specific mirror will be used for the upgrade.

If the mirror is also unavailable, use the following and so on until you find one that works for you.

All other methods are self-sufficient – they do not require to modify the sources.list file.

3. How to bypass ISP censorship to access Kali Linux servers

With TorIptables2 you can enable redirection of all traffic through Tor. Accordingly, all IPs and web-sites blocked by ISP will be available.

Install Tor and TorIptables2

sudo apt install tor
sudo systemctl start tor
sudo systemctl enable tor
git clone
cd toriptables2/
sudo mv /usr/local/bin/

Now, when you want to redirect all traffic through the Tor network (before updating, for example), simply run the command:

sudo -l

To return to the normal settings, do:

sudo -f

Attention: the words “all traffic” means “all HTTP traffic. Some programs send raw packets and/or ignore system-wide proxy settings. TorIptables2 redirects traffic without usage of the proxy settings, but using the Iptables firewall, but with raw packets you still need to be careful and double-check their path.

4. Redirecting traffic through the Tor network using Privoxy

With Privoxy, you can achieve exactly the same effect as with TorIptables2.

5. How to bypass ISP censorship using free VPNs

You can use the autovpn program, which will find a free OpenVPN server for you, download the configuration file and connect to it. You can select the country in which you want a VPN. More details in the article “Free easy way to hide IP in Linux”.

As well the ‘How to redirect all traffic through the Tor network’ will be useful for you if you want to use another tools to redirect traffic though Tor network.

Recommended for you:

Leave a Reply

Your email address will not be published.