2

I want to list all Head packages available from specific ppa.

Example: webupd8 ppa:nilarimogard/webupd8 has following head packages for trusty:

screen

Can I list them by command-line?

1 Answer 1

2

I've written a function that grabs the Packages list for the repo that would be used on the current release/architecture. It's fairly simple and could be written as a single line... It would just be a very unwieldy line.

function lsppa {
    # expects one argument in the form of ppa:nilarimogard/webupd8

    USAGE="lsppa <ppa:user/ppaname>"

    if [[ "$#" != "1" || ! "$1"  == *"ppa"* ]]; then
      echo "$USAGE"
      return
    fi

    REPO="${1/ppa:/}"
    CODE="$(lsb_release -cs)"
    ARCH="$(dpkg --print-architecture)"
    URL="http://ppa.launchpad.net/$REPO/ubuntu/dists/$CODE/main/binary-$ARCH/Packages"

    awk '/^Package:/ {print $2}' <(wget -qO- "$URL")
}

So after you paste that into a terminal, you can call it like lsppa ppa:nilarimogard/webupd8 and it returns a list as ordered by the packages list.

In this case it might be non-alphabetical and could even contain duplicates (different versions) so you might (you could pass it through sort -u if you want to call:

lsppa ppa:nilarimogard/webupd8 | sort -u | less
1
  • I added a simple usage check to the function. I hope you don't mind ☺. Jun 9, 2014 at 14:14

You must log in to answer this question.

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