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

Quentin Hartman qhartman at gmail.com
Wed May 2 14:22:10 MDT 2018


a slightly different grep seems to get there:

dpkg-query -W -f='${package}|${section}\n' '*' | grep '|x11'

or to re-use your example:

dpkg-query -W -f='${package}|${section}\n' '*' | grep '|hamradio'


QH

On Wed, May 2, 2018 at 2:11 PM, Jed S. Baer <blug at jbaer.cotse.net> wrote:

> 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 ham
> aldo|hamradio
> chirp-daily|hamradio
> cqrlog|hamradio
> cw|hamradio
> cwcp|hamradio
> hamlib-utils|
> hamlib1|
> hamlib2|
> hamlib3|
> hamlib4|
> libhamlib-utils|hamradio
> libhamlib2|libs
> morse|hamradio
> morse-x|hamradio
> qrq|hamradio
> xcwcp|hamradio
> xlog|hamradio
> xlog-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 as
> not-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 helpful
> library. The question is, can it be done using the supplied dpkg/apt
> command line utilities?
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join 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/beb0c7d9/attachment.html>


More information about the LUG mailing list