Wednesday, January 31, 2007

solving stucked debian package


If we tweak alot with our system, apt-get install this apt-get remove that, we might bumped into this error :

No override present.
dpkg: error processing cyrus-common (--remove):
subprocess post-removal script returned error exit status 2
Errors were encountered while processing:
cyrus-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
m


I was installing cyrus, and then removing, and then reinstalling again. And then want to remove again, then I bumped into this error.

I can't remove cyrus-common. I tried it with apt-get, dpkg, dselect, aptitude, synaptic, kpackage. It just stucked as installed, but when I tried to remove, it gave me that error.

Googled for a while. Find no paticular solution for my error, but found a tip that I should peek into /var/lib/dpkg/info/
Checked out cyrus-common.postrm file, commented out the first two of dpkg-stateoverride line. Save the postrm file. Run apt-get remove cyrus-common.
The command executed and exited gracefully, and deregister cyrus-common from dpkg list.

This is a quick and dirty solution. Basically I commented out the commands so that postrm will exit gracefully.

No comments: