Add repositories in Kali Linux 2.0

30,580

Step 1

To add repositories on most (if not all) Debian Derivative systems, the main way to go about doing this is to edit your sources.list file, found in /etc/apt/sources.list. To do this, use any editor of your choice to open the file. Once editing the file, it should look like this if you have never modified the sources.list file, and Kali was installed correctly:
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
Now you can add any repositories you like.

Step 2

The next step is to clean out all cached and non-wiped files from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. To do this, run the command apt-get clean. Next, update your package index files (so you can install packages from the repository you added) by running apt-get update. Upgrade all installed packages so you can download dependencies and resolve out-conflicts by running apt-get upgrade. The new repository you added may have some core packages, or system applications that need to be installed, so do so by using a smart dependency conflict resolution update with apt-get dist-upgrade. You should now be ready to go.

Warnings and Other Information

Generally for Kali (and usually for Kali only) it is a very bad idea to add repositories to your system, because they might break your Kali install. Because one of the main core functionalities of Kali is all the packages that come preinstalled, in a system manner of speaking, it is very unstable. If you install one package that needs certain dependencies or updates certain dependencies to so it is not backwards compatible, then you will essentially break some (or all) of the packages preinstalled in Kali, defeating the purpose of having Kali at all. Because of this mentality, Kali has grown to become very fragile. While Kali works perfectly well out of the box or with packages that you install from the official repositories, adding repositories may potentially break your system. According to the official Kali docs,

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

meaning that you should generally stay away from unofficial repositories while using Kali. In fact, according to the Kali docs,

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.

So, if you are following an internet tutorial or the like, be warned that adding unofficial repositories to you sources.list is the most common cause of a broken Kali system.

Final Notes

While this methods works on Debian Derivative GNU/Linux systems, it is advisable to stick with the official Kali Repositories for the most part. If you want to, certainly go ahead and add the repositories, but it is important to know what the repositories provide, and what, if any, packages will be updated when initiating apt-get upgrade, because they may break your other packages. For more information on Kali Repositories see here:

http://docs.kali.org/general-use/kali-linux-sources-list-repositories
https://wiki.debian.org/SourcesList
http://kaligr3y.blogspot.ie/2013/04/how-to-add-full-repository-in-kali-linux.html

Cheers,
Interesting...

Share:
30,580

Related videos on Youtube

Si Thu Phyoe
Author by

Si Thu Phyoe

Updated on September 18, 2022

Comments

  • Si Thu Phyoe
    Si Thu Phyoe over 1 year

    How do I add repositories in Kali Linux 2.0, and what, if any are the repercussions of doing so?