Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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