Kali Linux add PPA repository add-apt-repository

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

Step 1: Install required applications

First we install Python Software properties package.


apt-get install python-software-properties
 
Next we install apt-file



apt-get install apt-file


Update apt-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 got repo.kali.org in my /etc/apt/sources.list file instead of http.kali.org.)

Once apt-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 default add-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 line echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main" >> /etc/apt/sources.list I’ve used Oneiric. You can try to use Lucid, Raring or Saucy as per your choice.

Now chmod and chown 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 use add-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 added add-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 use add-apt-repository. Following is a way to bypass that and use /usr/bin/add-apt-repositoryby 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-release
DISTRIB_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-release
And 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

Name

7zip,1,Android,8,Android Emulator,1,APK,2,AppImage,1,Apple,3,APT,3,Arch,5,ASUS,1,Black Shark,1,BlueStack,1,Calculator,1,Cinnamon,1,Client,3,Code,3,Comic,1,Compression Tool,1,Debian,6,DELL,1,Desktop,2,Developers,3,Elementary OS,1,Encryption,1,FACEBOOK,1,Fedora,4,fix,2,Fortnite,1,Gadgets,4,Gamer,4,Gaming,1,geeks,11,GNOME,3,GNOME TWEAK TOOL,1,Google,2,Google Go,1,Hacking Tools,1,How To,19,IBM,1,IDE,1,Intel,1,iOS,4,iPads,1,Javascript,1,Kali Linux,1,KDE,2,Laptop,1,linux,24,Linux Mint,6,LXDE,1,Mac,2,MacOS,4,Manjaro,2,MATE,1,MX Linux,1,Network,3,NEWS,9,Open Source,16,OpenSuse,3,ParrotSec,1,Password,2,Programming,2,Programs,6,Repository,1,Review,2,ROG Phone,1,Security,4,Server,1,SmartPhone,3,SNAP,1,Snapd,1,Software,3,SONY,1,TECH,13,Text Editor,2,Torrent,1,tutorial,16,Ubuntu,10,Ubuntu Kylin,2,vim,1,VMware,1,VPN,1,Web Master,1,Whatsapp,1,Windows,5,Windows Phone,1,XFCE,1,Xiaomi,1,XPS,1,Zorin OS,1,
ltr
item
Linuxer Geeks: Kali Linux add PPA repository add-apt-repository
Kali Linux add PPA repository add-apt-repository
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Wcr1F8W8cyj4fSTbvvb1vEmc9QrflYvd5HVpCC7neZlN5oLWCY2dA7HveziMnLScGvuiHgRc5-LKosW3Yy5pKPGV51GmJCGnNFfRIFUszK59IullIEU5VSQ88wXVAhYs-wXn4PtcNA4/s320/kernel1.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Wcr1F8W8cyj4fSTbvvb1vEmc9QrflYvd5HVpCC7neZlN5oLWCY2dA7HveziMnLScGvuiHgRc5-LKosW3Yy5pKPGV51GmJCGnNFfRIFUszK59IullIEU5VSQ88wXVAhYs-wXn4PtcNA4/s72-c/kernel1.png
Linuxer Geeks
https://linuxergeeks.blogspot.com/2016/02/a-personal-package-archive-ppa-is.html
https://linuxergeeks.blogspot.com/
https://linuxergeeks.blogspot.com/
https://linuxergeeks.blogspot.com/2016/02/a-personal-package-archive-ppa-is.html
true
7822317774280320736
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy