after the installation of a package that was probably not made for your exact system especially when you forced the installation to ignore dependencies it might happen that you jam up your apt package manager. it gets even worse if you decide to manually delete the installed files.
i ran into this problem after installing the pt9500 cups wrapper and then deleting the installed files manually.
whenver i did something with apt-get be it install or remove a program i got this error:
Removing pt9500pccupswrapper ... /var/lib/dpkg/info/pt9500pccupswrapper.prerm: 3: /usr/local/Brother/PTouch/pt9500pc/cupswrapper/cupswrapperpt9500pc: not found dpkg: error processing pt9500pccupswrapper (--remove): subprocess installed pre-removal script returned error exit status 127 /var/lib/dpkg/info/pt9500pccupswrapper.postinst: 3: /usr/local/Brother/PTouch/pt9500pc/cupswrapper/cupswrapperpt9500pc: not found dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 127 Errors were encountered while processing: pt9500pccupswrapper E: Sub-process /usr/bin/dpkg returned an error code (1)
in order to get rid of this package i could not even use
apt-get remove cupswrapperpt9500pc
it showed the same errors.
your first try after this should be
sudo dpkg --remove --force-remove-reinstreq pt9500pccupswrapper
if you are lucky this will help if not, your apt is seriously broken..
now i think your only chance is to delete the dpkg stuff yourself.. i did it like so:
first i searched for anything that sounded like “pt9500” in my /var/lib/dpkg directory
/var/lib/dpkg$ find * | grep "pt9500"
this showed a list of files in the info/ folder
info/pt9500pccupswrapper.postrm info/pt9500pccupswrapper.postinst info/pt9500pccupswrapper.prerm info/pt9500pccupswrapper.list info/pt9500pccupswrapper.preinst info/pt9500pccupswrapper.conffiles
which i then removed:
mkdir /tmp/info sudo mv info/pt9500pccupswrapper.* /tmp/info/
just in case my system or apt crashes even worse afterwards i copied it to a directory that i created in /tmp where it will stay until i reboot my system.
now update your apt-get database and install missing dependencies:
apt-get -f install
this resolved my problems