-   Debian (
-   -   Local printer works fine with CUPS, but cannot use lp or lpr in Debian Squeeze/XFCE (

pcardout 05-16-2012 07:11 PM

Local printer works fine with CUPS, but cannot use lp or lpr in Debian Squeeze/XFCE
I have installed an HP_LaserJet_P1005 printer (I'm an expert on
this printer. It needs a special driver ... not a routine install).

I have used this printer before on the same computer, but today I
upgraded from a somewhat broken Lenny distro to a new Squeeze/XFCE distro. The CUPS web interface (localhost:631) shows the printer
and allows to print a test page, which looks fine.

I can even print an e-mail from gmail. All my command-line tools
are broken however. Here is sample output.


richard@feynman:~/aainfors$ lpq
no entries

richard@feynman:~/aainfors$ lpr testing.txt
richard@feynman:~/aainfors$ lpq
lp is ready and printing
Rank  Owner      Job  Files                    Total Size
active richard    17  testing.txt              16 bytes

richard@feynman:~/aainfors$ lprm
dfA017feynman dequeued
cfA017feynman dequeued

richard@feynman:~/aainfors$ lpq -PHP_LaserJet_P1005
lpq: HP_LaserJet_P1005: unknown printer

richard@feynman:~/aainfors$ lp testing.txt
request id is HP-LaserJet-2200-14 (1 file(s))

Note the following:

lpr says it's printing (but nothing ever comes out).

lp goes to a different printer (and that's not a local printer, and it doesn't work ... I don't care about that printer).

Somehow I think I need to get the CUPS queue for HP_LaserJet_1005P
connected to lpr. I can't figure out how to do that. I don't know
why CUPS didn't do that. One additional hint is I had to

apt-get install lpr after installing cups. So lpr wasn't there ...

Help would really be appreciated. I am a ten-year user of Debian/Ubuntu and have set up dozens of machines. I generally know my way around. If there are some .conf files to look for or touch I would be happy to do that.

michaelk 05-16-2012 08:03 PM

The default printer appears to be HP-LaserJet-2200-14. So you need to determine the correct queue name for your 1005.

Besides the cups web pages there are several CLI commands that provide status and information. Look at the man pages for lpstat and lpoptions. You can find out the default printer as well as what printers are configured and there queue names. If no default printer is defined then use the lpoptions to set a default printer.

If you do not specify a printer via the -P option lpr will use the default printer. lp uses the -d option to specify the printer.

pcardout 05-16-2012 08:56 PM

Local printer works fine with CUPS, but cannot use lp or lpr in Debian Squeeze/XFCE
Thanks Michaelk for the rapid and focused response!

I set the default printer with lpoptions.


lpoptions -d HP_LaserJet_P1005

richard@feynman:~$ lpstat -r -d
scheduler is running
system default destination: HP_LaserJet_P1005

lp -dHP_LaserJet_P1005 test.txt
request id is HP_LaserJet_P1005-20 (1 file(s))

I'm no longer in my office, so I can't tell if the file actually printed.
I messed around with cancel. It certainly suggests that the job is being put in the queue.


richard@feynman:~/$ lp S2012Class8.pdf
request id is HP_LaserJet_P1005-22 (1 file(s))
richard@feynman:~/$ cancel 22
richard@feynman:~/$ cancel 22
cancel: cancel-job failed: Job #22 is already canceled - can't cancel.

I've used lpr and lpq for years, but never lp and lpstat ... Whatever works!

I'll know tomorrow if I'm really out of the woods...

pcardout 05-17-2012 12:21 PM

SOLVED: Local printer works fine with CUPS, but cannot use lp or lpr in Debian Squeeze/XFCE
I still do not understand how lpr works differently, but using lp with the correct
print queue (or correctly set default printer using lpoptions -d) works perfectly.

Thank you thank you!

kareempharmacist 06-08-2012 05:25 PM

you should then mark this thread as solved..

pcardout 06-08-2012 05:40 PM

Thanks. I didn't notice the "solved" button on the upper right till you mentioned it. I've been on this site for 9 years. Either I'm very unobservant or this is a
somewhat new feature. I've been manually editing the subject lines to put "Solved" in them, and I had done that here as well.

All times are GMT -5. The time now is 10:45 PM.