[NCLUG] apt-get error code

Matt Taggart matt at lackof.org
Mon Apr 17 01:30:36 MDT 2006


Chad Perrin writes...

> subprocess post-removal script returned error exit status 2
> 
> What the heck does this mean?

Packages can have scripts that run relative to installation
preinst -> before installation
postinst -> after installation
prerm -> before removal
postrm -> after removal

These are used to prepare the system for the package (like adding system users 
for example) or clean up after removing (like package generated data). They 
are also invoked in various ways depending on if the package is being 
installed/configured/removed/purged. The details are defined by Debian Policy,

http://www.us.debian.org/doc/debian-policy/ch-maintainerscripts.html

> More to the point -- how do I fix it?

First, you should also check the Debian BTS to see if someone else has 
reported a problem. I don't see anything however,

http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=kdebluetooth&archiv
e=no&version=&dist=unstable

BTW what release are you running? These sorts of errors generally only occur 
in unstable, and they get fixed pretty quickly. But depending on what day you 
update, you see them every once in a while.

As dannf pointed out, package scripts are stored in /var/lib/dpkg/info/. You 
can try running that by hand and/or look at the code to see why it's failing. 
If the script doesn't have much output, you can add extra echo/print/etc 
statements to determine where it's getting stuck.

I tried both reinstalling it (to simulate an upgrade), and purging it, and I 
didn't have a problem. So maybe the error is in an older version of the 
package that you have one your system, or there is something different about 
your system.

> It seems to have completely wedged the entire apt system.

Yes, apt-get won't do anything else on packages that are further down the 
dependency chain until you've fixed that problem, because it's not something 
that's supposed to happen and it doesn't want to make things worse.

> It won't do crap
> as long as that problem exists.  Using force and fix options doesn't
> seem to help at all.

You shouldn't ever need the force or fix options. I know when I first moved 
from Red Hat to Debian I tried solving problems that way because I was used to 
similar options on Red Hat. But eventually I learned that you shouldn't ever 
normally need those options. They only exist for dpkg ninja's who are the only 
ones capable of getting their system it such a state that would require such a 
tool.

> The package that's wedging the system is kdebluetooth (a KDE package,
> color me surprised).  Google's no help to me, unless I'm searching
> "wrong".  The apt and dpkg documentation doesn't seem to have anything
> helpful to say about error codes.

The error message could have been slightly less cryptic, but I guess the docs 
just expected you to know about package scripts. This is the problem with 
documentation written by developers....

-- 
Matt Taggart
matt at lackof.org





More information about the NCLUG mailing list