add-apt-repository for kali linux

add-apt-repository is a script which adds an external APT repository to /etc/apt/sources.list or a file in /etc/apt/sources.list.d/

in this distro we did not find any such file. so, there are several stages to the addition of this file.

script:
#!/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 maverick 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

copy the script above, then save it with the name of the add-apt-repository.sh

then,move the file to directory /usr/sbin/ by name add-apt-repository.
*don't put .sh

# mv add-apt-repository.sh /usr/sbin/add-apt-repository
# chmod o+x /usr/sbin/add-apt-repository
# chown root:root /usr/sbin/add-apt-repository



Regards :
Hidemichi-Hiroyuki a.k.a [H2]

Comments

Post a Comment

Do Not Fuckin Spamming

Popular posts from this blog

Decrypt MD5 $Wordpress

Exploit Samba "SmbClient"

Configure Pure-FTP on Kali Linux