For the package script problem of "package_name
", you should look for:
/var/lib/dpkg/info/package_name.preinstYou edit the offending part of the script from the root:
by prepending it with "Then configures all partially installed packages by: # dpkg --configure -a
by appending it with "