Skip to content

/codes/apt/dpkg-package-states

dpkg -l status codes: ii, rc, un, iU, iF explained

The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
tool
apt
versions
dpkg 1.x
os
linux

Each line of dpkg -l starts with a status column of two or three characters. The first character is what you asked for (desired action), the second is the package's current state, and an optional third flags an error. ii means "should be installed, is installed"; rc means "removed, but configuration files are still there".

First character: desired action

CodeMeaning
uunknown
iinstall
hhold (do not change)
rremove (keep configuration)
ppurge (remove including configuration)

Second character: current state

CodeMeaning
nnot installed
cconfiguration files only
Hhalf-installed (installation started, not finished)
Uunpacked, not configured
Fhalf-configured (configuration failed)
Wtriggers awaited
ttriggers pending
iinstalled

Third character: error flag

R means reinstallation required; the package is broken and must be reinstalled.

Common combinations

bash
dpkg -l | grep '^rc' | awk '{print $2}'                  # leftovers of removed packages
dpkg -l | grep '^rc' | awk '{print $2}' | xargs -r sudo dpkg --purge
dpkg -l | grep -E '^.[HUFWt]'                            # packages in an unfinished state
sudo dpkg --configure -a                                 # finish configuring them

Sources