What do the various dpkg flags like 'ii' 'rc' mean?

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 third letter, but a space, instead):

  • R ... reinst-required (package broken, reinstallation required)

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'


Because my rep is low, I cannot comment to answer the questions people have about where to get this info. After reviewing source code for dpkg and related programs' main.c code, I found what I was looking for.

The info for reading the -l | --list output is in

man dpkg-query

and not in

man dpkg

dpkg is merely acting as the front-end in these instances