1

I was trying to update my kali2.0 machine through apt-get update,I properly configured sources.list as per kali linux repositories

I checked my Internet connection and its working fine,myself connecting through ipv4 eth0 connection and i tried to update through it ,but whenever i tried to update the machine i got the following error :

: Failed to fetch http://security.kali.org/kali-security/dists/sana/updates/Release.gpg  Cannot initiate the connection to kali2.mirror.garr.it:80 (2001:760:ffff:b0::34). - connect (101: Network is unreachable) [IP: 2001:760:ffff:b0::34 80]

While contacted kali forums they ask me to fix the network setup stating that "try to connect over IPv6 and IPv6 doesn't seem to work for you"

any options that i can dig deeper and fix my update?

i tried to prefer ipv4 /etc/gai.conf and uncomment the line to prefer IPv4 over IPv6.

anyother workaround for this?

3
  • Have you tried connecting to other mirrors?
    – Chong
    Nov 20, 2015 at 10:19
  • @Chong i tried official kali linux mirrors ,any link for other mirrors? Nov 20, 2015 at 10:19
  • try some mirrors in the mirror lists? Sometimes some of the auto-selected mirrors are under maintenance. docs.kali.org/community/kali-linux-mirrors
    – Chong
    Nov 20, 2015 at 10:24

1 Answer 1

1

In my case, my machine could not properly resolve the IP for the closest mirror to me: kali.mirror.garr.it. It appears that there was a problem with my ISP's DNS resolver.

To overcome this, I modified my /etc/resolv.conf file to use Google's DNS server for testing:

nameserver 8.8.8.8

The following script set_resolv_conf.py (tested on Kali Linux v2) automatically changes the DNS nameserver to Google's DNS server, 8.8.8.8.

Make sure you backup your current /etc/resolv.conf before you run the script below as it will overwrite your /etc/resolv.conf file as this script will overwrite your current /etc/resolv.conf file.

#!/usr/bin/python
RESOLV_CONF_FILE_PATH="/etc/resolv.conf"
GOOGLE_DNS_SERVER="8.8.8.8"

with open(RESOLV_CONF_FILE_PATH,"wb+") as f:
    f.write("search Home\n")
    f.write("nameserver {0}\n".format(GOOGLE_DNS_SERVER))

with open(RESOLV_CONF_FILE_PATH,"rb+") as f:
    print f.read()

Run the script as follows:

chmod ug+x set_resolv_conf.py
./set_resolv_conf.py

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .