SDB:Cancel Printing

Şuraya atla: kullan, ara


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.

  1. As the printer begins to prints nonsense, remove all the paper from an ink jet printer or open the paper tray for laser printers.
  2. Log in as user root.
  3. Type fuser -k /dev/lp0 if your printer is connected to the first parallel interface or fuser -k /dev/usblp0 or fuser -k /dev/usb/lp0 if it is a USB printer. This command kills every process that access the printer interface.
  4. Type lpc status or lpc 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
  1. 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.

SDB:Installing a Printer

<keyword>printer,printing,cancel,lprm</keyword>