apt-get Package Status Codes

Posted on Thursday 4 October 2007

If you’re a debian user (this includes all of you Ubuntu folks!), then you may be familiar with the strangeness of status codes for dpkg -l. For example, let’s say you install postfix:


sudo apt-get install postfix

We can look at the package list with dpkg -l. Let’s take a look at postfix:


$ dpkg -l | grep postfix
ii postfix 2.2.10-1ubuntu0.1 A high-performance mail transport agent

The ii at the start is some sort of status. Let’s remove the package:


sudo apt-get remove postfix

All fine and good, until we take a look at dpkg again:


$ dpkg -l | grep postfix
rc postfix 2.2.10-1ubuntu0.1 A high-performance mail transport agent

Hmm. Instead of removing it from the list, we see this peculiar rc status. What the heck does that mean?

The answer lies in the dpkg listing itself.


$ dpkg -l | head -3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)

There are three columns here, though y ou usually don’t see the third.

  • Desired: what state we wanted the package to be in. (Unknown/Install/Remove/Purge/Hold)
  • Status: what state the package is in now. (Not/Installed/Config-files/Unpacked/Failed-config/Half-installed)
  • Err: special errors. (none/Hold/Reinst-required/X=both-problems)

So, if you take the first letter of each potential state for each of those, you get your status code for dpkg. Let’s look at the some of these status codes again:

ii: Desired: (I)nstall; Status: (I)nstalled; Err: none.

rc: Desired: (R)emove; Status: (C)onfig-files; Err: none.

pi: Desired: (P)urge; Status: (I)nstalled; Err: none.

Mystery solved!

No comments have been added to this post yet.

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI