2

I am running kali linux and when I try to use command sudo add-apt-repository ppa:alex-wv/pulseaudio-equalizer-ppa, it gives me this code:

Traceback (most recent call last):
  File "/usr/bin/apt-add-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Kali/kali-rolling

I need help to make it work.

1

1 Answer 1

1

This is adapted and updated from this answer by user “Interesting...”:

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.

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 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

Source: https://docs.kali.org/general-use/kali-linux-sources-list-repositories

Now you can add any repositories you like by adding the repository address to the next line in your sources.list file and saving. Once saved, move on to Step 2.

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.

If you're trying to install a certain program, I'd search for Unix-build to build on your own from source.

For more information on Kali Repositories see here:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .