Skip to content

Instantly share code, notes, and snippets.

@ptaferner
Created November 21, 2015 10:03
Show Gist options
  • Save ptaferner/3215e8f97fd10d18c674 to your computer and use it in GitHub Desktop.
Save ptaferner/3215e8f97fd10d18c674 to your computer and use it in GitHub Desktop.
Manually remove a brocken debian package
# Sometimes a package does not install correctly and cannot be uninstalled either.
# All conventional commands fail like this:
#
# The following packages will be REMOVED:
# slapd
# Need to get 0 B of archives. After unpacking 4162 kB will be freed.
# dpkg: error processing slapd (--remove):
# Package is in a very bad inconsistent state - you should
# reinstall it before attempting a removal.
# configured to not write apport reports
# Errors were encountered while processing:
# slapd
# E: Sub-process /usr/bin/dpkg returned an error code (1)
# A package failed to install.
mv /var/lib/dpkg/info/PACKAGE.* /tmp/
dpkg --remove --force-remove-reinstreq PACKAGE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment