The Three-Column Structure
The status field consists of three characters. Each character represents a specific aspect of the package's lifecycle:
- Desired State (What you told the system to do)
- Current State (What is actually on the disk)
- 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)
- Meaning: Desired Install, Current Installed.
- Status: Healthy. The package is installed and working correctly.
- Action: None required.
rc (Residual Configuration)
- Meaning: Desired Remove, Current Config-files.
- Status: The software is removed, but its configuration files remain on the disk.
-
Action: If you want a clean slate, purge it:
sudo apt purge <package-name>
pn (Purged)
- Meaning: Desired Purge, Current Not-installed.
- Status: The package and its config files are completely gone. It effectively doesn't exist on the system anymore.
- Action: None required.
iU or iF (Broken/Incomplete)
- Meaning: Desired Install, but Current state is Unpacked or Failed-config.
- Status: The installation process was interrupted or failed.
-
Action: Attempt to fix broken packages:
sudo dpkg --configure -a
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'