PDA

View Full Version : Enabling Network Repositories / Fixing Corrupt sources.list File



g0tmi1k
2015-08-31, 07:59
This is a how to guide to enable Network Repositories, if during the setup of Kali you didn't:


Have Internet access for whatever reason (e.g. no drivers, incorrect IP/subnet/proxy, it dropped etc)
Didn't select to use them


... then network repositories would NOT have been added.
This will be an issue when you try and use 'apt-get install <package_name>' to install a new package or upgrade current ones.

The issue
Here are some screens, showing signs of the network repositories will not be configured to be used.

http://i.imgur.com/h51KYmFh.png (http://i.imgur.com/h51KYmF.png)
Images are from a "Text Install". Graphical install will have the same message(s) displayed.

During your install, you must select here to use it (next screen will ask for proxy information - if it's required):

http://i.imgur.com/GYGdVVVl.png (http://i.imgur.com/GYGdVVV.png)
Images are from a "Text Install". Graphical install will have the same message(s) displayed.


Solution
In a terminal window, paste the following:


cat <<EOF > /etc/apt/sources.list
deb http://http.kali.org/kali sana main non-free contrib
deb-src http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security/ sana/updates main contrib non-free
deb-src http://security.kali.org/kali-security/ sana/updates main contrib non-free
EOF

apt-get update


Troubleshooting
If you are still facing issues using network repositories, please share the output of:


curl -sI http://http.kali.org/README

This is because http.kali.org and security.kali.org are load balancers. They will automatically redirect you to the closest mirror based on your GeoIP.

Example output:


root@kali:~# curl -sI http://http.kali.org/README
HTTP/1.1 302 Found
Date: Sat, 29 Aug 2015 14:52:29 GMT
Server: Apache/2.2.22 (Debian)
X-MirrorBrain-Mirror: ftp.free.fr
X-MirrorBrain-Realm: country
Link: <http://http.kali.org/README.meta4>; rel=describedby; type="application/metalink4+xml"
Link: <http://ftp.free.fr/pub/kali/README>; rel=duplicate; pri=1; geo=fr
Link: <http://mirror.pcextreme.nl/kali/README>; rel=duplicate; pri=2; geo=nl
Link: <http://ftp.halifax.rwth-aachen.de/kali/README>; rel=duplicate; pri=3 geo=de
Location: http://ftp.free.fr/kali/README
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

root@kali:~#

...as well as the exact error message(s) that's on screen.
Without both bits of information, it's hard to know which mirror is having issues (and what the issues are!)


Useful links

Kali sources.list Repositories (http://docs.kali.org/general-use/kali-linux-sources-list-repositories)
Official Kali Linux Mirrors (http://docs.kali.org/community/kali-linux-mirrors)
Mirror Listing (http://http.kali.org/README.mirrorlist)
Troubleshooting - Repository Issues (https://forums.kali.org/showthread.php?20810-Troubleshooting-Repository-Issues)



Any off topic replies will be deleted.