Q: How to forcefully remove a package marked rH by dpkg? I tried to install the Canon CQue driver for my printer by downloading the .deb file from Canon's website and installing it with
dpkg -i filename.deb
The installation didn't finish and I always get an error when doing apt upgrade. I listed the status by sudo dpkg -l | grep cqu and it was listed as iF.
I read the man page for dpkg-query, but I don't know what "Half installed" means. So I tried uninstalling it with sudo dpkg -r cque-en, but I got an error. I tried to sudo apt install --fix-broken, but that fails too with the error:
Removing cque-en (4.0-6) ...
dpkg: error processing package cque-en (--remove):
 installed cque-en package post-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
Errors were encountered while processing:
 cque-en
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Now the result of sudo dpkg -l | grep cqu is
rH  cque-en  4.0-6   amd64  CQue - Driver for Canon iR, CLC, LPB and MF laser devices (English).

sudo apt remove gives me the same error as above.
What does the error status 127 mean anyway? And how do I remove a package marked as rH by dpkg? Is there a way to force it?

A: I ended up doing
sudo rm -f /var/lib/dpkg/info/cque-en.postrm
(whereas the -f is probably not needed).
Not the nicest of solutions, but at least I can update and upgrade my system without getting any error message and everything seems to be working just fine for the time being.
