Customizing Kali Linux for faster package updates

Kali contains more than 300 security tools and system binaries. After installing Kali Linux, first thing you would need to do is update the Kali Linux to get the latest collection of security tools and features. Since Kali is based on Debian Linux, you can use the apt-get update command to update the repositories for the binaries and tools.

However, at times while updating Kali Linux, you will notice that updates can be slow regardless of your Internet speed and bandwidth. In this recipe, we will show you how you can update your source file, which your package manager refers to, for faster package updates:

Getting ready

For this recipe, you will need a connection to the Internet with a valid IP address.

How to do it...

Perform the following steps for this recipe:

  1. Open the terminal and use an editor to open the sources.list file:
     vim /etc/apt/sources.list
    
  2. The default sources.list file looks like:
     #deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL Binary 20140721-23:20]/ kali contrib main non-free
     deb http://http.kali.org/kali kali main non-free contrib
     deb-src http://http.kali.org/kali kali main non-free contrib
     ## Security updates
     deb http://security.kali.org/kali-security kali/updates main contrib non-free
    

    All you need to do is to change http to repo as shown in the following code:

     #deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL Binary 20140721-23:20]/ kali contrib main non-free
     deb http://repo.kali.org/kali kali main non-free contrib
     deb-src http://repo.kali.org/kali kali main non-free contrib
     ## Security updates
     deb http://security.kali.org/kali-security kali/updates main contrib non-free
    
  3. Make the following changes, save the file, and exit the editor by pressing the Esc key and then type wq! and press Enter.
  4. Now, update and upgrade your Kali using the following command; you will notice the difference in speed:
     apt-get update && apt-get upgrade
    

How it works...

Kali Linux has multiple different mirrors around the world. Based on your IP address location, it automatically selects the mirror closest to your location. Due to various reasons, these mirrors may become slow over a period of time. You can find the list of mirrors closest to your location at http://http.kali.org/README.mirrorlist . The apt-get command takes the list of update servers from /etc/apt/sources.list. Changes made to the sources.list files ensures that our Kali connects to the correct servers and gets served with faster updates.