Last active
December 14, 2015 15:09
-
-
Save SalemHarrache/5106233 to your computer and use it in GitHub Desktop.
add-apt-repository for debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NM=`uname -a && date` | |
NAME=`echo $NM | md5sum | cut -f1 -d" "` | |
UBUNTU_VERSION=${2:-"lucid"} | |
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 $UBUNTU_VERSION main" >> /etc/apt/sources.list | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wget https://gist.github.com/SalemHarrache/5106233/raw/e8b634ddebb793ee5032941ff08d131c94c4cb36/add-apt-repository.sh -O /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
Install sublime-text-2:
sudo add-apt-repository ppa:webupd8team/sublime-text-2 && sudo apt-get update
sudo apt-get install sublime-text-2