Read more

Fix "subprocess installed post-removal script returned error exit status ..." when installing/removing/updating a package with apt

Kim Klotz
October 13, 2015Software engineer at makandra GmbH

If you get an error like:

subprocess installed post-removal script returned error exit status 78
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

when installing/removing/updating a package with apt you should check the postinst, postrm, prerm, ... script in /var/lib/dpkg/info/.

For example in my case I had a problem when removing varnish:

Removing varnish (4.0.3-2~trusty) ...
dpkg: error processing package varnish (--remove):
 subprocess installed post-removal script returned error exit status 78
Errors were encountered while processing:
 varnish

So I checked the /var/lib/dpkg/info/varnish.postrm for exit 78 and found the following:

[...]
        if test -e /var/lib/varnish; then

                rm -r /var/lib/varnish > /dev/null 2>&1 || exit 78
        fi
[...]

This directory couldn't get removed because there was a mount to /var/lib/varnish/. After I've unmounted it, it could get successfully removed.

Posted by Kim Klotz to makandra dev (2015-10-13 23:21)