UPDATE: Thanks to Msz Junk for pointing out the typos in the file paths.
What I really should have done was to link to khattam’s article because he did a pretty good job of describing the solution to this error but for my own archives, here goes…. I upgraded my box to Karmic Koala this evening and for some reason, ubiquity-frontend-kde flipped and borked the package management system. When I tried to open Synaptic, I got this:

So I tried
sudo aptitude –configure -a
and
sudo apt-get install -f
and even tried messing with these:
/var/lib/dpkg/info/dbconfig-common.postinst
/var/lib/dpkg/info/dbconfig-common.postrm
but the system wouldn’t budge. Then I found khattam’s article and realized I was looking in the wrong files. To solve this error, close all package management software, and back up and edit the /var/lib/dpkg/status file with the following commands:
sudo cp /var/lib/dpkg/status /var/log/dpkg/status.old
gksudo gedit /var/lib/dpkg/status
Here comes the dicey part. Search for the package causing all this brouhaha and delete its entry. Please be very careful here and make sure you leave a blank line between the package entries below or above the deleted package entry. Here are screenshots of my file before and after selecting the appropriate package description entry.
If you did this right you should be able to open Synaptic and remove the offending package (if you don’t want it any more) or re-install it.I don’t understand why the developers couldn’t cook up a more graceful way for dpkg to show its displeasure.




I received the following error:
E: /var/cache/apt/archives/python-gst0.10_0.10.14-1ubuntu1_i386.deb: subprocess new pre-removal script returned error exit status 1
I looked at all the google errors didn’t help at all. Then looked closely at how dpkg worked.
I found out that the deb files are in archive format (ar).
So I unpacked the deb file with:
ar x python-gst0.10_0.10.14-1ubuntu1_i386.deb
and got the following files:
-rw-r–r– 1 root root 3579 2009-10-27 12:25 control.tar.gz
-rw-r–r– 1 root root 501047 2009-10-27 12:25 data.tar.gz
-rw-r–r– 1 root root 4 2009-10-27 12:25 debian-binary
I tarred xzvf the files and got lots of files but especially
the file called “prerm” ie. pre-removal script.
So it appears this script crapped out but why.
Inside it looks at the current python version.
I had previously mistakenly thought I can set the version of python I can use by using ubuntu’s update-alternatives command:
update-alternatives (8) – maintain symbolic links determining default commands
Bad news it broke some assumptions in this prerm script file! I removed the symbolic link from the update-alernative command and just relinked python to python2.5 binary and the dpkg appears now to work. Phew looks like every problem in the deb infrastructure is probably caused by non-robust code in script files and/or in my case there are too many ways to change the system without understanding some of the consequences.
By: Jon Hornstein on October 27, 2009
at 1:21 pm
Thank you, I had this problem and your post helped me.
Sucessfull operation.
By: Alexandre Penchel on November 9, 2009
at 12:49 pm
thanks. need the info how to disable a package lost after two updates !!
By: lamedp on November 10, 2009
at 10:18 pm
Thanks. This worked.
One small rectification though: your code
sudo cp /var/log/dpkg/status /var/log/dpkg/status.old
gksudo gedit /var/log/dpkg/status
should be (lib instead of log)
sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.old
gksudo gedit /var/lib/dpkg/status
By: Msz Junk on November 10, 2009
at 11:04 pm
Thank you so much! This error happened with my Flash installation so I was without Flash for days until I found this fix.
By: AndrewNoNumbers on November 15, 2009
at 8:05 pm
Thanks for the tips. Worked like a charm! I had a half-configured mdadm. I’m not running RAID, so I guess I can live without that package anyway.
By: Darius Bundrent on November 17, 2009
at 8:56 pm
god damn it…
why aren’t you ranked number one in Google with this !!!!
I spent like hours testing all other kind of tricks that did not work
THANKS A LOT !!!
By: dGo on April 22, 2010
at 11:13 am
Thank you very much for this! It saved my day!
I have only experience with RPM packages and this deb thing is very new to me. I thought that I would have to start from scratch again…
By: Thomas on June 15, 2010
at 6:32 am
Thanks. This did the job.
By: Jojo on July 3, 2010
at 4:23 am
Thanks soooo much this worked on my new installation of Mint. You’re a saint!
By: JoeOnMint on August 20, 2010
at 9:17 am
Great
By: MeF on November 2, 2010
at 3:39 pm
great tutorial, really helped! worked perfectly for me for the spoonwep removal. real pain in the ass. keep up the good work
By: Jacob on May 2, 2011
at 9:54 am
Thanks for this!
By: memedroid on January 9, 2012
at 12:38 pm
Thanks A MILLION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thanks also to MSZ JUNK, for the rectification.
So rarely do I get a solution that actually works. You da man (or woman)!!!!!!!!!
By: friedrice on February 10, 2012
at 3:33 am
[...] http://linuxtrove.com/wp/?p=187http://odzangba.wordpress.com/2009/10/14/how-to-fix-%E2%80%9Csubprocess-pre-removal-script-returned-…http://ubuntu.igameilive.com/2009/11/how-to-fix-installed-post-installation.htmlhttp://www.noobslab.com/2011/11/install-plymouth-manager-and-change.html Share this:ShareEmailRedditPrintStumbleUponFacebookTwitterDiggLike this:LikeBe the first to like this post. [...]
By: Error: subprocess pre-removal script returned error exit status 2? « harian k_de (kdenotes) on March 21, 2012
at 1:03 am
thanks..work like magic
By: cheersman on March 28, 2012
at 3:25 pm