Kali Linux fix problem add-apt-repository ppa

Hello everyone, Today I will show you how to solve the problem of Kali Linux

How to add repository?
when we run the command : sudo add-apt-repository ppa:teejee2008/ppa
We get results "NoDistroTemplateException"

root@Lh4cKg:~# sudo add-apt-repository ppa:teejee2008/ppa
You are about to add the following PPA to your system:

 More info: https://launchpad.net/~teejee2008/+archive/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 160, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 96, in __init__
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 584, in reload_sourceslist
  File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

create add-apt-repository

root@Lh4cKg:~# wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
root@Lh4cKg:~# cp add-apt-repository.sh.txt /usr/sbin/add-apt-repository
root@Lh4cKg:~# chmod o+x /usr/sbin/add-apt-repository
root@Lh4cKg:~# chown root:root /usr/sbin/add-apt-repository

happy done!

About Lasha Gogua

    Blogger Comment
    Facebook Comment


  1. It worked perfectly, thank you very much!

  2. I am using kali linux amd64 v4.0.0 this solution is not working anymore please help me.

  3. it worked like a magic. many forums cant give a perfect answer for this. you did! thank you :)

  4. https://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt

    stupid morons

  5. Didn't work for me.
    I had to edit the /user/lib/python3/dist-packages/aptsources/district.py

    if self.source template is None:
    raise NoDistroTemplateExeption(
    "Error: could not find distribution template for %S/%S"

    Process: gksudo gedit /usr/lib/python3/dist-packages/aptsources/distro.py
    Change "error" to "pass", no quotes.

    Now I am fairly new to kali and python scripts in general. I hope this won't pose a future problem, but everything look all good on my side. Though some confirmation that what I'm doing will be of no consequence would be nice.