[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting a list of installed packages

Quoting Robert Guthrie (rguthrie@pobox.com):
> On Wednesday 15 November 2000 11:43, Moritz Schulte wrote:
> > Robert Guthrie <rguthrie@pobox.com> writes:
> > > I'm using this command:
> > > dpkg -l * | egrep "^ii" | grep -i kde
> <snip>
> > > What I'm trying to get is the full version information.  I only care
> > > about that and the package name.
> >
> > You can do it with awk: dpkg -l | awk '{ print $2 " " $3 }'
> >
> > 	moritz
> That didn't work either.  It seems that anything I run through a pipe gets 
> truncated.  I'm not sure why.  If I just run dpkg -l all by itself, I get a 
> nicely spaced output that I could cut and past from, but that would require 
> me to do the work that my computer should do for me ;-).  Any suggestions?  
> Running this at the console (as opposed to an X terminal window) doesn't 
> behave any differently.

I'm not sure what you mean by pipes and truncation. The output of
dpkg -l is stuffed into columns whose width appears to be variably-
fixed according to the version/distribution.

If you're to happy fiddle with the output, a better start may be
dpkg -s `dpkg --get-selections | cut -f1` | less
but why bother--- /var/lib/dpkg/status contains all this and more.
You've just got to ignore the paragraphs that don't contain
a Version: line.


Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.

Reply to: