Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I frequently need to check which packages are installed, and I use the following command:

dpkg -l | grep foo

which gives the following output

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version         Description
ii   foo                       <version>         <description>
  1. What does the ii mean?
  2. What other flags are there?
  3. How to read the flags? (because the explanation is quite complicated, IMO)

Thanks.

share|improve this question

2 Answers 2

up vote 31 down vote accepted

Where to find this information in the system

You can find this information out in the head of dpkg -l output, as it's just a formatting convention:

dpkg -l | head -3

Copied here for reference:

Desired=Unknown/Install/Remove/Purge/Hold                                     
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)                    

Description of each field

As you can see from the first three lines:

First letter -> desired package state ("selection state"):

  • u ... unknown
  • i ... install
  • r ... remove/deinstall
  • p ... purge (remove including config files)
  • h ... hold

Second letter -> current package state:

  • n ... not-installed
  • i ... installed
  • c ... config-files (only the config files are installed)
  • u ... unpacked
  • f ... half-configured (configuration failed for some reason)
  • h ... half-installed (installation failed for some reason)
  • w ... triggers-awaited (package is waiting for a trigger from another package)
  • t ... triggers-pending (package has been triggered)

Third letter -> error state (you normally shouldn't see a thrid letter):

  • r ... reinst-required (package broken, reinstallation required)
share|improve this answer
    
(The vertical bars and slashes in the second, third and fourth line of the header are "arrows" pointing to the first, second and third columns, to help you decipher what htorque has explained in greater depth.) –  Ubuntourist Dec 25 '10 at 15:03
    
where can I read this list? I tried man dpkg but it was not there. –  Fabrizio Regini Jan 9 at 17:51
    
@FabrizioRegini Try again, it's right at the top of dpkg's man page (section "INFORMATION ABOUT PACKAGES"). :) –  htorque Jan 13 at 20:42
    
Where in the dpkg man page does it show the meaning of 'ii', 'if', and so on? –  pmatulis May 28 at 20:26
    
it's a formatting thing. thankfully the output itself makes it clear. I'll update the answer with details. –  dpb May 30 at 20:30

The first letter displays what is the expected status of the package.
The second letter displays what is the current status of the package.

So for example:

ii means 'It should be installed and it is installed' whereas
rc means 'It's removed/uninstalled but it's configuration files are still there'

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.