Skip to content

Instantly share code, notes, and snippets.

@Bost
Forked from jnakatsui/list-ppa
Last active July 26, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bost/66638cab114a6da691518598b6d13650 to your computer and use it in GitHub Desktop.
Save Bost/66638cab114a6da691518598b6d13650 to your computer and use it in GitHub Desktop.
list ppa on *nix system
#!/usr/bin/env bash
# get all the PPAs installed on a system ready to share for reininstall
for APT in `find /etc/apt/ -name \*.list`; do
# list found files - helps in case of: '... public key is not available: NO_PUBKEY'
echo $APT
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
echo sudo ppa-purge ppa:$USER/$PPA
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment