From the archive: originally published on blog.cronky.net in 2009. Some links may have rotted.

Quick fix for annoying Ubuntu package removal problem

This error message has been annoying the hell out of me anytime I try and do anything with my packages on my Ubuntu server: subprocess post-removal script returned error exit status 2 Following the instructions at http://www.cyberciti.biz/tips/troubleshooting-debian-ubuntu-package-upgrades-removals.html (expect that I had to comment out the line set -e with a # and hey presto package installation and removal works again! Phew. Sometimes Linux still requires hacking about - but I guess at least you can get in there and fix things once you know how - unlike the dll-registry hell / black box of Windows!