apt-popcon() { (echo \#rank; apt-cache search "$@" |awk '$1 !~ /^lib/ {print " "$1" "}') |grep -Ff- <(wget -qqO- http://popcon.debian.org/by_inst.gz |gunzip); }

Search for packages, ranked by popularity

This will take the packages matching a given `apt-cache search` query (a collection of AND'd words or regexps) and tell you how popular they are. This is particularly nice for those times you have to figure out which solution to use for e.g. a PDF reader or a VNC client. Substitute "ubuntu.com" for "debian.org" if you want this to use Ubuntu's data instead. Everything else will work perfectly.
Sample Output
$ apt-popcon pdf 'viewer|reader'
#rank name                inst  vote   old recent no-files (maintainer)
437  poppler-utils       66519 10611 46940  8953    15 (Loic Minier)
794  evince              49734 31780 11813  6129    12 (Debian Gnome Maintainers)
891  evince-common       46071     0     0     0 46071 (Debian Gnome Maintainers)
1768 texlive-base        21932 10747  9236  1927    22 (Debian Tex Maintainers)
2235 gir1.2-evince-3.0   14571  3403  4527  6640     1 (Debian Gnome Maintainers)
2366 texlive-latex-extra 13550  1690  8065  3792     3 (Debian Tex Maintainers)
2370 gnome-sushi         13512  1435  8648  3427     2 (Debian Gnome Maintainers)
2444 okular              12726  8158  3776   791     1 (Debian Qt/kde Maintainers)
2696 xpdf                10854  5399  5027   403    25 (Michael Gilbert)
3385 gv                   6570  3344  3083   141     2 (Bernhard R. Link)
4004 epdfview             4861  2606  1567   687     1 (Yves-alexis Perez)
4603 xpdf-reader          3491   249  1105    14  2123 (Michael Gilbert)
4615 calibre-bin          3479   934  1986   557     2 (Miriam Ruiz)
4653 calibre              3425   935  1959   531     0 (Miriam Ruiz)
5461 antiword             2396  1108  1225    62     1 (Olly Betts)
5685 mozplugger           2173  1513   631    29     0 (Alessio Treglia)

4
By: adamhotep
2012-09-08 00:29:31

These Might Interest You

  • Can't remember what that one package was called? Search for it! It's also a good idea to run apt-get update first. Show Sample Output


    -10
    apt-cache search php5
    sudopeople · 2012-09-20 21:14:50 0
  • # Search for an available package on Debian systems using a regex so it only matches packages starting with 'tin'.


    0
    aptitude search ^tin
    defiantredpill · 2011-10-20 17:51:36 0
  • Shows the packages installed on your system that are recomemnded by other packages. You should remove these packages. Show Sample Output


    1
    aptitude search '?and( ?automatic(?reverse-recommends(?installed)), ?not(?automatic(?reverse-depends(?installed))) )'
    wei2912 · 2012-07-28 05:45:21 0
  • I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well. Show Sample Output


    1
    dpkg --list '*linux*' | grep '^ii'
    piyo · 2009-02-13 17:05:37 1
  • You can use wildcard with rpm search but you have to do 2 things: 1. use "-a" switch (means "all") with query ("-q") switch - argument is a pattern to use while searching for package names of all installed packages 2. protect wildcards, so that shell could not eat them - escape it with backslash ("\") or enclose all pattern between apostrophes ("'"): rpm -qa 'co*de' As you can see above it is possible to insert wildcards into middle of the pattern. If you want, you can add "-i" or another rpm query options, "-i" will print package information for all installed packages matching pattern. Show Sample Output


    2
    rpm -qa \*code\*
    alcik · 2009-03-11 21:16:23 1
  • Search the names and descriptions of all available packages and prints out the name and the short description.


    0
    apt-cache search someregex
    chrisdrew · 2009-02-07 09:15:19 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: