Allow apt-get to connect to Internet (Kali Linux)

While performing an apt-get update with Kali Linux, packages cannot be retrieved, but a ping works. sources.list file needs to be setup.

To fix it in a terminal:

  1. Type sudo -i
  2. Type touch /etc/apt/sources.list
  3. Type chmod 644 /etc/apt/sources.list
  4. Type echo “deb http://http.kali.org/kali kali-rolling main contrib non-free” > /etc/apt/sources.list
  5. Type apt-key adv –keyserver hkp://keys.gnupg.net –recv-keys 7D8D0BF6
  6. Type apt-get update
  7. Good to go.