JP Vossen on 29 Jun 2008 11:51:58 -0700


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

[PLUG] Listing packages (was Server h/w migration)


> Date: Sat, 28 Jun 2008 16:25:42 -0400
> From: "David A. Harding" <dave@dtrt.org>

> On Sat, Jun 28, 2008 at 03:55:46PM -0400, JP Vossen wrote:
>>  > From: <dave@dtrt.org>,  Sat, 28 Jun 2008 01:04:51 -0400
>>  > dpkg --get-selections | grep '\<install$'
>>
>> I use 'dpkg-query --show'
> 
> Your command may print uninstalled packages.  From my desktop:
> 
>   $ sort <( dpkg --get-selections | grep '\<install$' | cut -d'^I' -f1 ) \
>          <( dpkg-query --show     | cut -d'^I' -f1 )  | 
> 		uniq -u | COLUMNS=80 xargs dpkg -l | head
> 
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
> ||/ Name           Version        Description
> +++-==============-==============-============================================
> rc  alsa-oss       1.0.12-1       ALSA wrapper for OSS applications
> rc  apache2-common 2.0.54-5sarge1 next generation, scalable, extendable web se
> rc  armagetron     0.2.7.0-1.1    3D Tron-like high speed game
> rc  armagetron-com 0.2.7.0-1.1    Common files for the Armagetron packages
> rc  armagetronad   0.2.8.2.1-7    3D Tron-like high speed game


Now that is interesting...  I didn't know that.

For me, the two status codes I get are:
$ dpkg-query --show --showformat='${Status}\t${Package}\t${Version}\n' | 
cut -f1 | sort -u
deinstall ok config-files
install ok installed

Same results this way too:

$  dpkg -l xvidtune cdrecord
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: 
uppercase=bad)
||/ Name              Version           Description
+++-=================-=================-==================================================
rc  cdrecord          10:2.01.01a33-0ub command line CD writing tool
rc  xvidtune          1:1.0.1-0ubuntu2  X client - xvidtune


So poking around a bit more I find the following give the same results, 
though yours is much shorter.  Likewise, changing to 'deinstall' also 
produces the same output:

$ dpkg-query --show --showformat='${Status}\t${Package}\t${Version}\n' | 
grep '^install' | cut -f2

$ dpkg --get-selections | grep '\<install$'

Mine has the option to give version number (cut -f2-) though that's only 
useful for auditing, not really for new installs like my original context.


Per above cdrecord xvidtune are marked removed, or "deinstall ok 
config-files" or "deinstall", but they aren't and I don't want them to 
be and I never marked them as such that I recall:
	$ which cdrecord xvidtune
	/usr/bin/cdrecord
	/usr/bin/xvidtune

So now I'm (even more) confused, since the stuff I spot-checked is there 
and is installed.  What is "deinstall ok config-files" (or whatever) 
supposed to mean?

I mostly love apt, but this kind of thing drives me nuts.  There are so 
many wildly different ways to get almost-but-not-quite the same thing. 
Even thought it's much less powerful, 'yum <something> | 'rpm 
<something>' are much more predictable and more importantly more 
discoverable than then vast multitude of dpkg*, apt*, and other apt 
tools.  :-/


So:
1) What is "deinstall ok config-files" (or whatever) supposed to mean?

2) What's the canonical (take that whichever way you choose :) way to 
list the installed packages on a Debian-ish system?  ('rpm -qa' is 
canonical, definitive, fast and easy.  And 'rpm -qa --nodigest 
--nosignature' is even faster.)


Thanks,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|        jp{at}jpsdomain{dot}org
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug