apt-get update error in Kali Linux after dist-upgrade

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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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.

Method 2

Issue At Hand

You are unable to update Kali Linux. This answer is assuming that you have installed Kali Linux or are running it in a Live Persistent configuration. If you are not or do not know what I mean, please refer to the Official Kali Linux Documentation

Solution

According to the Official Kali Linux Documentation concerning the sources.list file. Your /etc/apt/sources.list should look exactly like this:

 deb http://http.kali.org/kali kali-rolling main contrib non-free
 # For source package access, uncomment the following line
 # deb-src http://http.kali.org/kali kali-rolling main contrib non-free

Make sure there is no other repositories or lines because according to the documentation:

The single most common causes of a broken Kali Linux installation are following unofficial advice, and particularly arbitrarily populating the system’s sources.list file with unofficial repositories. The following post aims to clarify what repositories should exist in sources.list, and when they should be used.

Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL.

You can uncomment the last line at your discretion as well. Make sure to run apt update and you should be good.

If You Continue to Have Issues

Do you continue to get the initial error that you reported?

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.
  1. Verify Network Connectivity

Test your network connection. Can you communicate with other devices on the network? Can you browse the web or otherwise communicate outside of your network? If you ping www.google.com are you able to resolve the address? Does any of the ICMP packets time out? If you are connected and can resolve domain names, attempt apt update again. Update your post if this does not work with the error you get.

  1. Check your firewall settings

Verify that your firewall on your Kali Linux install or your router is not blocking traffic.

  1. Make sure you are not Live booting and are actually booted into your install or persistent instance.
  2. Check out this post and see if any of the solutions could help.

Best of Luck!


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x