How to add PPA in Debian?

PPAs (short for Personal Package Archives) are software repositories hosted by launchpad.net, designed for Ubuntu users and are easier to install than other third-party repositories. You can get more details from its home page.

Then, is it possible for us to use PPA in Debian?  Yes we can. We basically need two steps,  find the right release that suits for our system, then import the APT keye

There is a script do these for us, and you can download it here.

#!/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

You only need to rename this script as /usr/sbin/add-apt-repository with right permissions (that’s root ownership with 755 in permission), then we can use it like how to install rethinkdb here,

sudo add-apt-repository ppa:rethinkdb/ppa
sudo apt-get update
sudo apt-get install rethinkdb
Share Button

Leave a comment

Your email address will not be published. Required fields are marked *