Thursday, January 19, 2017

How to show list of PPA repo on Ubuntu

In the world of ubuntu, you will find your self adding more and more PPA repository to your system, and it's hard to keep track of PPA repository inside our machine, there is no tool that can show the list of PPA repo on our local computer.

But don't worry, we can create a shell script that can show us list of PPA repository on our ubuntu, just follow this simple and easy step by step tutorial

Step by step how to create a shell script that can show list of PPA repository ubuntu
  • first open GEDIT or other text editor on ubuntu
  • then copy paste code below:
  • #! /bin/sh 
    # listppa Script to get all the PPA installed on a system 
    for APT in `find /etc/apt/ -name \*.list`; do
        grep -o "^deb[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
  • save the file as
  • on the command line, give permission to execute
  • chmod +x
  • run the script from command line
  • ./

Run the script every time you want to see the list of PPA repo on your machine.

No comments:

Post a Comment