2

How do I check whether I already have a certain ppa in my list? How do I search through my list of ppas?

842Mono
  • 9,790
  • 28
  • 90
  • 153

1 Answers1

3

This can be achieved with an altered version of the script which can be found here.

#! /bin/sh 
find /etc/apt/ -name '*.list' | while read -r apt 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 "ppa:$user/$ppa" | grep "$1"
        done
done

So in order to search for PPAs which contain a certain string run it as follows (in this example I have assumed that you have saved the file as searchPPAs and have also made it executable (chmod +x searchPPAs — make sure you do this in the same directory you save the file in)):

./searchPPAs <stringToSearchFor>
muru
  • 197,895
  • 55
  • 485
  • 740
  • awesome it works! thank you so much. ...that's much nicer than just throwing a duplicate don't you think? -_- It's not even a duplicate it's just similar. – 842Mono May 08 '16 at 18:16
  • @MinaMichael: You're welcome! Originally though I thought it was a duplicate until I read the answer for the duplicate and found it wasn't... As soon as I realised that though I retracted my close vote and posted an answer instead. :) –  May 08 '16 at 18:18