A Personal Package Archive (PPA) is a special software repository for
uploading source packages to be built and published as an APT
repository by Launchpad or a similar application. While the term is used
exclusively within Ubuntu, Launchpad host Canonical envisions adoption
beyond the Ubuntu community.
Debian allows users to add and use PPA repositories by an application named add-apt-repository however, Kali Linux didn’t include this in their default package list. With Kali, because this is a special purpose application and certain modifications were made to make it work for what it does best (Penetration Test), there’s a chance that by adding untested and unsupported PPA repositories and application you might end up breaking your installation.
However, PPA is a powerful tool to have and a lot of the specific applications that are not available in repositories are available via PPA repositories. Users should take extra care before adding unknown and random repositories as it might very well break other things. I mean, how do you know the PPA owner didn’t add some harmful code in their system? Generally, you don’t. Then again, how do you know that Linux Kernel doesn’t have something that’s spying on your activity? But I guess that doesn’t matter, your ISP would be happy enough to hand over your online activity to NSA anyway … I could go on and on, but let’s not waste more time and move to actual post “Kali Linux add PPA repository add-apt-repository” .. so here goes ..
/usr/sbin/add-apt-repository ppa:noobslab/themes /usr/sbin/add-apt-repository ppa:alecive/antigone Once you’ve added a PPA repository via
apt-get update You’ll see that your package list is now including PPA repository
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION=”Ubuntu 12.04 LTS”
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION=”Ubuntu 11.10″
That mean’s now you can either use Precise or Oneiric codes as you feel like.
Now you should be able to add PPA just like normal.
To rollback your changes to Distribution ID, Release, Codename and Description, do the following,
Output:
Just kidding… You don’t actually have to do it (well you could, but what’s the point to making things complicated). You could just delete
We again do antther
Debian allows users to add and use PPA repositories by an application named add-apt-repository however, Kali Linux didn’t include this in their default package list. With Kali, because this is a special purpose application and certain modifications were made to make it work for what it does best (Penetration Test), there’s a chance that by adding untested and unsupported PPA repositories and application you might end up breaking your installation.
However, PPA is a powerful tool to have and a lot of the specific applications that are not available in repositories are available via PPA repositories. Users should take extra care before adding unknown and random repositories as it might very well break other things. I mean, how do you know the PPA owner didn’t add some harmful code in their system? Generally, you don’t. Then again, how do you know that Linux Kernel doesn’t have something that’s spying on your activity? But I guess that doesn’t matter, your ISP would be happy enough to hand over your online activity to NSA anyway … I could go on and on, but let’s not waste more time and move to actual post “Kali Linux add PPA repository add-apt-repository” .. so here goes ..
Step 1: Install required applications
First we install Python Software properties package.apt-get install python-software-properties
Next we installapt-file
apt-get install apt-file Updateapt-file
. apt-file update
This takes a while, so in case your apt-file update is SLOW, you might want to try and fix that as well. (Note that I gotrepo.kali.org
in my/etc/apt/sources.list
file instead ofhttp.kali.org
.) Onceapt-file update
is complete, you should be able to search for it. apt-file search add-apt-repository Your output should look similar to this:
python-software-properties: /usr/bin/add-apt-repository python-software-properties: /usr/share/man/man1/add-apt-repository.1.gz
Step 2: Use our own code for add-apt-repository
The defaultadd-apt-repository
application located in (/usr/bin/add-apt-repository
)
works for Debian. So if you’re using Kali, chances are it won’t work.
There’s a nice fix for that which I will add at the bottom of this post,
(try them on VirtualBox if you feel like). But I found we can just
mimic Ubuntu Oneiric
to make
add-apt-repository
work.cd /usr/sbin
vi add-apt-repository
Add the following code and save the file. #!/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 oneiric 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
Note: In this lineecho "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main" >> /etc/apt/sources.list
I’ve usedOneiric
. You can try to useLucid
,Raring
orSaucy
as per your choice. Nowchmod
andchown
the file.
chmod o+x /usr/sbin/add-apt-repository chown root:root /usr/sbin/add-apt-repository
Step 3: Adding a PPA repository via add-apt-repository in Kali Linux
Now that we added the correct code, we can useadd-apt-repository
to add a PPA repository. I tried the following to add themes and custom icons in Kali Linux./usr/sbin/add-apt-repository ppa:noobslab/themes /usr/sbin/add-apt-repository ppa:alecive/antigone Once you’ve added a PPA repository via
add-apt-repository
in Kali Linux, you need to update your package list.apt-get update You’ll see that your package list is now including PPA repository
Step 4: Testing
Now that we have addedadd-apt-repository
to add PPA repository
in Kali Linux, we can try to add some themes and custom icons. To keep
things clean, I’ve moved this part in a different describing adding
custom themes and icons in Kali Linux.Step 5: Advanced Way
(Continued from Step 2: Paragraph 1)
In Step 2, paragraph 1, I pointed that we need to use our own code to useadd-apt-repository
. Following is a way to bypass that and use /usr/bin/add-apt-repository
by modifying your Distribution ID. I again advise that you try this part in Virtual Box so that you can roll back your changes.Step 5.a Install Python Software Properties:
Install Python Software properties package.apt-get install python-software-properties -y
Step 5.b Change Distribution ID, Release, Codename and Description
Change your Distribution ID to Ubuntu, Release to 12.04, Codename to Precise and Description to Ubuntu 12.04 LTS.echo -e "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=12.04\nDISTRIB _CODENAME=precise\nDISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"" >> /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION=”Ubuntu 12.04 LTS”
echo -e "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=11.10\nDISTRIB _CODENAME=oneiric\nDISTRIB_DESCRIPTION="Ubuntu 11.10"" >> /etc/lsb-releaseDISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION=”Ubuntu 11.10″
That mean’s now you can either use Precise or Oneiric codes as you feel like.
Now you should be able to add PPA just like normal.
Step 5.c Add PPA Repositories
Add PPA repositories using usual/usr/bin/add-apt-repository
add-apt-repository ppa:upubuntu-com/chat apt-get update
Step 5.d Install something (i.e.Skype?)
Now we can install Skype..apt-get install skype
Step 5.e Rollback changes
No change is much good without a rollback strategy.To rollback your changes to Distribution ID, Release, Codename and Description, do the following,
echo -e "DISTRIB_ID=Debian\nDISTRIB_RELEASE=Kali Linux 1.0.6\nDISTRIB _CODENAME=n/a\nDISTRIB_DESCRIPTION="Debian GNU/Linux Kali Linux 1.0.6"" >> /etc/lsb-releaseAnd to confirm, do another
lsb_release -a
lsb_release -a
Output:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux Kali Linux 1.0.6 Release: Kali Linux 1.0.6 Codename: n/a
Just kidding… You don’t actually have to do it (well you could, but what’s the point to making things complicated). You could just delete
/etc/lsb_release
file that was created in Step 5.e.rm /etc/lsb_release
We again do antther
lsb_release -a
to confirm
COMMENTS