[lug] Command line challenge: list all debian packages in a section

stimits at comcast.net stimits at comcast.net
Wed May 2 14:34:33 MDT 2018


If you change the order of output, then you can also use sort and uniq. Example to list sections:
dpkg-query -Wf='${section}\t${package}\t\${status}\n' | sort | cut -f1 | uniq
 
Example to list everything in shells:
dpkg-query -Wf='${section}\t${package}\t${status}\n' | egrep '^shells'
 
----- Original Message -----From: Jed S. Baer <blug at jbaer.cotse.net>To: lug at lug.boulder.co.usSent: Wed, 02 May 2018 20:11:38 -0000 (UTC)Subject: [lug] Command line challenge: list all debian packages in a section

I just tried to figure out how to do this. Seems it should be easy, eh?

$ dpkg-query -W -f='${package}|${section}\n' '*'| grep -i hamaldo|hamradiochirp-daily|hamradiocqrlog|hamradiocw|hamradiocwcp|hamradiohamlib-utils|hamlib1|hamlib2|hamlib3|hamlib4|libhamlib-utils|hamradiolibhamlib2|libsmorse|hamradiomorse-x|hamradioqrq|hamradioxcwcp|hamradioxlog|hamradioxlog-data|hamradio

Okay, where's fldigi?

I appears that from the manpage: 'If no package-name-pattern is given,list all packages in /var/lib/dpkg/status, excluding the ones marked asnot-installed', one can't infer that in the presence of a pattern,not-installed packages will be listed.

No doubt there's a way to do this using Perl or Python, and some helpfullibrary. The question is, can it be done using the supplied dpkg/aptcommand line utilities?_______________________________________________Web Page: http://lug.boulder.co.usMailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lugJoin us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20180502/4798f8da/attachment.html>


More information about the LUG mailing list