Linux: Package Status Flags

When managing packages on Debian-based systems (like Ubuntu, Debian, or Linux Mint), the command dpkg --list is your primary tool for auditing installed software. However, the cryptic three-letter codes at the start of each line (e.g., ii, rc , pn) often confuse users.

This guide breaks down exactly what those flags mean, how to read them, and how to troubleshoot common states.

The Three-Column Structure

The status field consists of three characters. Each character represents a specific aspect of the package's lifecycle:

  1. Desired State (What you told the system to do)
  2. Current State (What is actually on the disk)
  3. Error State (If something went wrong)

You can see this legend by running dpkg --list and looking at the header:

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)

1. Desired State (Column 1)

What action is scheduled for this package?

Flag

Meaning

Description

u Unknown The package state is undefined. i Install Marked for installation (the standard state for most apps). r Remove Marked for removal (binaries gone, config files kept). p Purge Marked for purging (binaries and config files deleted). h Hold Marked to be held (prevents automatic updates).

2. Current State (Column 2)

What is the actual status of the package on your system?

Flag

Meaning

Description

n Not Installed The package is not present on the system. i Installed Successfully installed and configured. c Config-files Only configuration files remain (package removed). u Unpacked Files are extracted but not yet configured. f Half-configured Configuration failed during installation. h Half-installed Installation failed midway. W Triggers-awaiting Waiting for a trigger from another package. t Triggers-pending Has been triggered but not yet processed.

Note: Uppercase letters in the status column (like F or H) generally indicate a problem state.

3. Error State (Column 3)

Did an error occur?

This column is usually a space (indicating no error). If an issue exists, you will see:

Flag

Meaning

Description

R Reinst-required The package is broken and must be reinstalled.

Common Combinations Explained

Here are the most frequent status codes you will encounter in the wild:

ii (The Ideal State)

rc (Residual Configuration)

pn (Purged)

iU or iF (Broken/Incomplete)

Quick Troubleshooting Cheat Sheet

Problem

Command to Fix

Remove leftover config files (rc) sudo apt purge <package> Fix broken installation (iF, hF) sudo dpkg --configure -a Fix missing files (iR) sudo apt install --reinstall <package> List only broken packages dpkg -l | grep '^..R' List ALL Non-Healthy Packages (including broken, half-configured, or residual configs) dpkg -l | grep -v '^ii'