Tuesday, December 8, 2015

How to show list of PPA repository on Lubuntu


Alright from the previous post, we know how to add and remove PPA repository on lubuntu, but what about showing list of PPA repository on lubuntu, how to do that?

Don't worry, in this article i will teach you how to show list of launchpad PPA repository that's exist on our system (lubuntu).

Actually there is no command that can do that, there is one command called apt-cache policy, which will show PPA repository but also other repo and it seems not showing all the list, not very accurate.

apt-cache policy

To show list of PPA repository on lubuntu, we need to create a shell script (bash script) that can output list of launchpad PPA repository on our system.

Step by step how to show list of PPA repository on lubuntu

  • open leafpad or gedit or whatever text editor you like
  • copy paste this code into the editor

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

  • save as listppa.sh
  • give permission to execute, open terminal/console and go to where the listppa.sh file is located, and then run this command:

  • chmod +x listppa.sh

  • run the .sh from terminal/console, like this:

  • ./listppa.sh

  • enjoy your life



~ cheers ~

No comments:

Post a Comment