SDB:Cancel Printing
Symptom
Your printer prints "nonsense", like several empty or nearly empty pages or unreadable character strings.
Cause
Your printer is not set up correctly, because a wrong Ghostscript driver was selected, or you tried to print (as user root) with cat file >/dev/lp0
or the connection to the printer was interrupted during printing (unreliable hardware). Basically, the printer receives data that it cannot interpret. For example,
- non-ASCII characters or the printer is not able to print ASCII characters directly (GDI printer)
- graphical data in a unsuitable format (wrong or no Ghostscipt driver)
- unreliable hardware
Solution
The following solution is not intended for a standard case. Normally an accidental printing can be cancelled with the command lprm
.
- As the printer begins to prints nonsense, remove all the paper from an ink jet printer or open the paper tray for laser printers.
- Log in as user root.
- Type
fuser -k /dev/lp0
if your printer is connected to the first parallel interface orfuser -k /dev/usblp0
orfuser -k /dev/usb/lp0
if it is a USB printer. This command kills every process that access the printer interface. - Type
lpc status
orlpc status all
to see every existing printer spooling queue. Suppose the following printer spooling queues are shown:
lp: color: Then erase all printjobs from every printer spooling queue with the commands: lprm -Plp - lprm -Pcolor - or lprm -Plp all lprm -Pcolor all or lprm -Pall all
- Turn your printer off completely and switch it on again.
It is possible that your printer will only work again after rebooting or after stopping the printer daemon, unloading the kernel modules that concern printer interfaces, reloading the kernel modules, and restarting the printer daemon.
<keyword>printer,printing,cancel,lprm</keyword>