After a dist-upgrade I can not update Kali and sudo apt-get update returns this error.

Err:1 http://http.kali.org/kali kali-rolling InRelease
  Connection failed [IP: 192.99.200.113 80]
Reading package lists... Done
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  Connection failed [IP: 192.99.200.113 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

I searched for update errors in kali but couldn't find this error.

This is my sources.list file.

#

#deb cdrom:[Debian GNU/Linux 2017.3 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20171109-13:49]/ kali-rolling contrib main non-free

#deb cdrom:[Debian GNU/Linux 2017.3 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20171109-13:49]/ 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

How can I fix this?

Best Answer


Can you see the repository (http.kali.org/kali) in a browser? Does it show 'Index of /kali' in your browser?

If you can't see the Index then it might be the cause of firewall/proxy blocks your connection. Please check with your network admin in that case.

Also try to open this URL https://http.kali.org/kali from a browser. If it shows 'index' in browser then please go for solution 1.

Solution 1:

Try using https repository by executing the following command

echo "deb https://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list

Then try sudo apt-get update If you find the same error, please choose another solution.

Solution 2: please execute the following command.

apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 7D8D0BF6

Then try sudo apt-get update If you find the same error, please choose another solution.

Solution 3: Please keep a back up file before changing the sources.list file Using text editor add these lines to /etc/apt/sources.list file

deb http://http.kali.org/ /kali main contrib non-free
deb http://http.kali.org/ /wheezy main contrib non-free
deb http://http.kali.org/kali kali-dev main contrib non-free
deb http://http.kali.org/kali kali-dev main/debian-installer
deb-src http://http.kali.org/kali kali-dev main contrib non-free
deb http://http.kali.org/kali kali main contrib non-free
deb http://http.kali.org/kali kali main/debian-installer
deb-src http://http.kali.org/kali kali main contrib non-free
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

Then try sudo apt-get update If you find the same error, please choose another solution.

solution 4: Are you using any proxy server? Then,

check the file /etc/apt/apt.conf

Please add the following three lines in /etc/apt/apt.conf

Acquire::http::proxy "http://proxy:port/";
Acquire::ftp::proxy "ftp://proxy:port/";
Acquire::https::proxy "https://proxy:port/";

write your IP address in place of 'proxy'

write your port number in place of 'port'

Then try sudo apt-get update If you find the same error, please choose another solution.