Created
April 1, 2015 21:15
-
-
Save francislewis/f786713e031a1db5bb26 to your computer and use it in GitHub Desktop.
A script to show all ppas on current system
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/sh | |
# Script to get all the PPA installed on a system | |
for APT in `find /etc/apt/ -name \*.list`; do | |
grep -Po "(?<=^deb\s).*?(?=#|$)" $APT | while read ENTRY ; do | |
HOST=`echo $ENTRY | cut -d/ -f3` | |
USER=`echo $ENTRY | cut -d/ -f4` | |
PPA=`echo $ENTRY | cut -d/ -f5` | |
#echo sudo apt-add-repository ppa:$USER/$PPA | |
if [ "ppa.launchpad.net" = "$HOST" ]; then | |
echo sudo apt-add-repository ppa:$USER/$PPA | |
else | |
echo sudo apt-add-repository \'${ENTRY}\' | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment