Skip to content

Instantly share code, notes, and snippets.

@rsrini7
Forked from ashwin/list_ppa.sh
Created June 1, 2016 06:16
Show Gist options
  • Save rsrini7/db641efa73f865819f328241bbd69da3 to your computer and use it in GitHub Desktop.
Save rsrini7/db641efa73f865819f328241bbd69da3 to your computer and use it in GitHub Desktop.
List PPA repositories on an Ubuntu system
#! /bin/sh
# listppa Script to get all the PPA installed on a system ready to share for reininstall
# From: http://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line
for APT in `find /etc/apt/ -name \*.list`; do
grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
echo sudo apt-add-repository ppa:$USER/$PPA
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment