Skip to content
September 27, 2016 / alancads

Adding PPA’s in Debian Linux

# apt-get install python3-software-properties apt-file

# apt-file update

# apt-file search add-apt-repository

# cd /usr/sbin

# vim add-apt-repository

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

2 – Paste and save the file

# pwd
/usr/sbin
# chmod o+x add-apt-repository
# chown root:root add-apt-repository

3 – Enjoy!

# ./add-apt-repository ppa:noobslab/themes
noobslab/themes
Executing: /tmp/tmp.MXIP4f3ZtC/gpg.1.sh –keyserver
keyserver.ubuntu.com
–recv-keys
D530E028F59EAE4D

# cat /etc/apt/sources.list
deb http://ppa.launchpad.net/noobslab/themes/ubuntu trusty main
# apt-get update
# apt-get install application

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: