How do I clear a Print-queue in Ubuntu?
Solution 1
The question was how to kill all jobs. The simple way to kill all jobs:
lprm -
The complicated linux old-school way is below:
Command line:
lpstat -o
to view outstanding print jobs.
cancel -a {printer}
to cancel ALL jobs or ...
cancel {printerjobid}
to cancel 1 job.
Solution 2
Either
- Use the printer dialog: type "Printers" in the dash and navigate to the printer
- Use the CUPS web interface: point your browser at
http://localhost:631/jobs/
and proceed from there - Use the command line interface: use
lpq
to see jobs,lprm
to remove. Refer toman lprm
for more information.
Solution 3
Use
lpstat -W completed -o
to view list of completed jobs.
Use
lpstat -o
to view list of not-completed jobs.
And to delete job list,just use this command:
cancel -a -x
This will cancel all pending jobs, as well as deleting them.
Solution 4
Well, answers given here didn't work for me so here's what I did -
ps aux | grep printer
kill {printer job}
Solution 5
I tried using lpstat
and lprm
but was unable to figure out basic things like the job number and stuff. Instead, I used the command:
lpq
This produced:
zac@computer:~$ lpq
lpq: Error - no default destination available.
A quick Internet search and then I tried:
zac@computer:~$ lpq -a
Rank Owner Job File(s) Total Size
1st zac 85 TorahNT.odt 59392 bytes
FINALLY I find the all important Job number: 85!
NOW I run lprm
:
zac@computer:~$ lprm 85
zac@computer:~$
And to confirm I did this:
zac@computer:~$ lpq -a
no entries
zac@computer:~$
Finally, the printer queue is empty.
Related videos on Youtube
Norman Woodcock
Updated on September 18, 2022Comments
-
Norman Woodcock almost 2 years
I am an absolute beginner with Ubuntu and I appear to have a long queue of documents in my H.P. 840C printer.
-
Rinzwind almost 11 yearshmm that is weird. are you sure you inserted a printer id?
-
Y.Millner about 10 yearsDidn't work for me. :(
-
MichaelChirico about 9 yearsIs there something like
lprm *
that will cancel all jobs? Or do we have to go piecemeal? -
João Silva about 9 yearsHi, this didn't work for me either. Deleting the printer and adding it again did the task, though.
-
Andrei over 8 yearsMAGIC : ) Guys who aren't having success, step 2 above? The readout from lpstat -o should look something like <yourusername_printername>. Just type that verbatim into {printer} in step 2. Worked fine in Ubuntu 15.04. Tnx Rinzwind :)
-
Rinzwind over 8 years@Manuel you are welcome :)
-
zwets over 8 years@MichaelChirico
man lprm | grep "cancel all jobs"
-
Gerhard Stein over 7 yearsFunny, this works very well, but not when using gnome-printers gui. Too bad!
-
Rinzwind over 7 years@Gerstrong do you get a notice? Cuz this is totally outside of gnome-printers scope. Commandline always wins here ;)
-
Gerhard Stein over 7 yearsNo, notice at all, no reaction. The jobs stays there. Command Line in contrast removes it.
-
Rinzwind over 7 yearsLikely you need sudo from the gui.
-
vcarel over 6 yearsThis should be the accepted answer.
-
Zanna about 2 yearsReally nice clear answer - very helpful for people unfamiliar with the commands, thanks!