Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to list PPA repositories

📅 2015-Aug-04 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ ppa, ubuntu, y ppa manager ⬩ 📚 Archive

The Y PPA Manager is a GUI that can be used to view, add or remove PPA repositories in Ubuntu. If you prefer the shell, the add-apt-repository program can be used to add or remove PPA repositories. However, there is no program that lists the PPA repositories you have added to your system.

Here is a popular shell script that lists PPA repositories:

#! /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

Tried with: Ubuntu 14.04


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧