Skip to content

Instantly share code, notes, and snippets.

@bergercookie
Last active April 22, 2021 11:26
Show Gist options
  • Save bergercookie/94a67453281cae030a5bbeeafcd92349 to your computer and use it in GitHub Desktop.
Save bergercookie/94a67453281cae030a5bbeeafcd92349 to your computer and use it in GitHub Desktop.
Script to get all the PPA installed on a system
#! /bin/sh
# Link: https://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line-into-an
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 ppa:$USER/$PPA
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment