Issue
- Unable to clear the CUPS print spool queue
- Having problems clearing the document queue, showing 300 jobs stuck in the “Sending” status for days
- Unable to cancel the stuck jobs in the print queue
- Does restarting the cups daemon clear the print queue?
- How to make a
cron
job which should delete the print jobs older than 5 days? - How to remove pending jobs from queue?
- How do I clear existing jobs from the print queue(s),
Resolution
The cancel
and lprm
commands can be used to cancel/remove print jobs from print queues.
cancel
cancel -a <queue-name>
cancels all print jobs associated with a print queue. By default, this can only be done asroot
. For example:12cancel -a lp12cancels all print jobs on print queue “lp12”.
cancel -a
cancels all jobs on all print queues. This will completely clear out all print jobs — held, pending, and active. By default, this can only be done asroot
.cancel <job-id>
cancels a particular job. For example:12cancel 23172cancels the print job with ID 23172. This can be done as a non-privileged user, if it is the user that submitted the job. By default
root
can cancel any job.
lprm
lprm -P <queue-name>
cancels all print jobs associated with a print queue. By default, this can only be done asroot
. For example:12lprm -P lp12removes all jobs on print queue “lp12”. This will completely clear out all print jobs — held, pending, and active. By default, this can only be done as
root
.lprm -
removes all print jobs on all print queues.lprm <job-id>
cancels a particular job. For example:12lprm 23172removes the print job with ID 23172.