Hey Guys, today i'm gonna show you how to fix NoDistroTemplateException in Kali Linux :)
Suppose i want to add some repository through command line in Kali linux! Then Kali's terminal throws exception i.e. NoDistroTemplateException and i am unable to add repository! :( here is the pic =>
but today i'm with a hardcore solution to this problem
create a file named add-apt-repository.sh.txt and add the following lines of code!
Suppose i want to add some repository through command line in Kali linux! Then Kali's terminal throws exception i.e. NoDistroTemplateException and i am unable to add repository! :( here is the pic =>
but today i'm with a hardcore solution to this problem
create a file named add-apt-repository.sh.txt and add the following lines of code!
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
else
echo "$ppa_name"
echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu lucid main" >> /etc/apt/sources.list
apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
rm -rf /tmp/${NAME}_apt_add_key.txt
fi
else
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
fi
Save it! and now open the terminal and use the following commands
that's it reboot your system and the fuckin NoDistroTemplateException is gone! :) enjoy adding new repositories! :)
Thank you man!!!
ReplyDelete