5

Lets imagine I have a added a repository called ppa:something/amazing, but I have forgotten what the PPA was all about and the name of the PPA is too vague or the PPA is a very large one. I want to check what it is without using an internet browser and going to the Launchpad website. Is there a way to view information about the PPA from the command line? I am mainly interested viewing a list of the packages contained in the PPA.

2
  • Software center >> Edit >> source sources >> Other software Feb 24, 2013 at 21:34
  • @SrinivasGowda I am looking for a command-line way... also, that doesn't show the list of packages anyway. Feb 24, 2013 at 21:40

2 Answers 2

4

Assuming you have the package list downloaded (apt-get update will do that) you could see there what packages are available for your distribution from that PPA.

If you want some shell code this should do the trick:

PPA=ppa:something/amazing
less $(echo "$PPA"|sed -e 's!/!_!' -e 's!^ppa:!/var/lib/apt/lists/ppa.launchpad.net_!' -e 's!$!_ubuntu_dists_'$(lsb_release -sc)'_main_binary-'$(dpkg --print-architecture)'_Packages!')
3

Here is a shell script based on this answer:

#!/bin/bash

if [ $# -eq 1 ]; then
    CMD=s
    PPA=$1  
else
    CMD=$1
    PPA=$2
fi

case "$CMD" in
"-f" | "f")
    cat $(echo "$PPA"|sed -e 's!/!_!' -e 's!^ppa:!/var/lib/apt/lists/ppa.launchpad.net_!' -e 's!$!_ubuntu_dists_'$(lsb_release -sc)'_main_binary-'$(dpkg --print-architecture)'_Packages!') | less
    ;;
"-s" | "s")
    cat $(echo "$PPA"|sed -e 's!/!_!' -e 's!^ppa:!/var/lib/apt/lists/ppa.launchpad.net_!' -e 's!$!_ubuntu_dists_'$(lsb_release -sc)'_main_binary-'$(dpkg --print-architecture)'_Packages!') | grep 'Package:' | sed 's/Package: //'
    ;;
*)
    echo "Usage: $0 [mode] PPA"
    echo ""
    echo "mode:"
    echo "  -f:  Displays detailed information about each package in the PPA"
    echo "  -s:  Displays only the names of the packages in the PPA"
    ;;
esac

Save this to a file, such as ppa-info, and make sure it is located within the system path and is executable.

When you run this with just the name of a PPA (or the option -s), it will simply print a list of the names of all the packages in the PPA. However, if you run it with the option -f, it will print detailed information about all the packages in the PPA, just as in the original answer.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .