LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-16-2012, 08:11 PM   #1
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Rep: Reputation: 24
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.

Code:
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.
 
Old 05-16-2012, 09:03 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,063

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
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.
 
1 members found this post helpful.
Old 05-16-2012, 09:56 PM   #3
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Original Poster
Rep: Reputation: 24
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.

Code:
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.

Code:
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...
 
Old 05-17-2012, 01:21 PM   #4
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Original Poster
Rep: Reputation: 24
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!
 
Old 06-08-2012, 06:25 PM   #5
kareempharmacist
Member
 
Registered: Jan 2012
Location: Cairo Egypt
Distribution: CrunchBang,Linux Mint,Slackopuppy
Posts: 266

Rep: Reputation: 18
you should then mark this thread as solved..
 
Old 06-08-2012, 06:40 PM   #6
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Ubuntu ("karmic", "oneiric")
Posts: 214

Original Poster
Rep: Reputation: 24
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.
 
  


Reply

Tags
cups lpd lpr laserjet


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS web interface: IPP printer queue cannot be started (CLI works fine) lefty.crupps Linux - Software 0 04-07-2010 12:37 PM
CUPS problem with shared printer: lp works, lpr doesn't HeavyTortoise Linux - Software 1 10-03-2005 03:59 PM
just installed CUPS printer is OK.. but can't print Error: loop in printcap on lpr soylentgreen Linux - Newbie 4 09-23-2004 11:41 AM
lpr & lpr-cups commands not working with CUPS trinbellwoods Debian 2 01-08-2004 09:25 AM
printer keeps trying to print postscript. works fine using lpr Choey Linux - Hardware 1 09-20-2003 07:06 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration