LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2011, 03:45 PM   #1
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Rep: Reputation: 2
Question Printing from Command Line won't work - just sits in print queue


CUPS was not originally installed on my server, I have installed it but cannot print to my network printer. On my laptop, I can... they are both running the same version of Debian. What could be missing?

Here are some details...

I have two computers running the same version of Debian. One is a server with no GUI and the other is my laptop with GDM installed. My laptop (which prints with no problem) is connected via Wifi. My server is connected directly to the router via Ethernet. I cannot print from the server.

The printer is a Canon Pixma MP495 that connects to the router via Wifi. I have downloaded drivers for the printer from http://support-au.canon.com.au/conte...100301501.html and installed them successfully using dpkg on both computers.

Right now I have a regular text file that I am using for a test page. To print from my laptop (with success) I type:
Code:
cat test.txt | lpr
This does not work from the server. What could I be missing?

lpq run on server:
Code:
root@server:# lpq
lp is ready and printing
Rank   Owner      Job  Files                                                                              Total Size
active root       14   (standard input)                                                                   54 bytes
lpinfo readout:
Code:
root@server:# lpinfo -v
network ipp
network beh
serial serial:/dev/ttyS0?baud=115200
serial serial:/dev/ttyS1?baud=115200
direct scsi
network http
network socket
network lpd
network cnijnet:/87-65-43-1C-C5-A3

Last edited by flipjarg; 04-03-2011 at 04:09 PM. Reason: added lpq and lpinfo readout
 
Old 04-03-2011, 06:57 PM   #2
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
One other thing I noticed:

lpq shows there is a job in the queue but when I use the web interface (at http://localhost:631/admin) there are no jobs.

I have also set the printer to shared.. my laptop discovered the printer, shared through the server. So I printed via the share, through the server and the page printed. However, I still cannot print from the server, via the command line.
 
Old 04-03-2011, 07:16 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
My first swag is the default printer name is not the same as your network printer.
Can you print a test page via cups printers webpage successfully?
Try instead
lpr -P printername test.txt
 
Old 04-03-2011, 07:17 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,898

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Here's a tutorial that might help: http://www.debiantutorials.org/debia...linux-etch-228.
 
Old 04-03-2011, 07:32 PM   #5
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by michaelk View Post
My first swag is the default printer name is not the same as your network printer.
Can you print a test page via cups printers webpage successfully?
Try instead
lpr -P printername test.txt
I cannot print a test page from the CUPS printer webpage. Also, here are is the readout of your suggestion:

Code:
root@server:# lpr -P MP495LAN test 
lpr: MP495LAN: unknown printer
I think you're onto something.


Quote:
Originally Posted by bigrigdriver View Post
Here's a tutorial that might help: http://www.debiantutorials.org/debia...linux-etch-228.
Thanks I was looking for one but the ones I could find seemed incomplete... I will check it out.

Last edited by flipjarg; 04-03-2011 at 07:47 PM.
 
Old 04-03-2011, 07:55 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
Ok look at the output and post the info for your printer:
localhost:631/printers
 
Old 04-03-2011, 07:59 PM   #7
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by michaelk View Post
Ok look at the output and post the info for your printer:
localhost:631/printers
I already deleted the printer and added it through the cups web interface... printed a test page and it worked. However printing with lpr -P printername test.txt will not work still.

Here is the info on the localhost:631/printers page:

Code:
▼ Queue Name ▼	Description	Location	Make and Model	                Status
cMP495	        cMP495		                Canon MP495 series Ver.3.40	Idle

Last edited by flipjarg; 04-03-2011 at 09:18 PM.
 
Old 04-03-2011, 09:20 PM   #8
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Also...
Code:
root@server:# lpstat -v
device for cMP495: cnijnet:/88-88-88-8C-C8-8A
So far I cannot find any useful reading material on this. Thanks for the help.
 
Old 04-03-2011, 09:50 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
At first glance looks ok. What happens when you try:
lpr -P cMP495 test.txt
 
Old 04-04-2011, 07:15 PM   #10
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by michaelk View Post
At first glance looks ok. What happens when you try:
lpr -P cMP495 test.txt
Unfortunately, this:
Code:
root@server:# lpr -P cMP495 test.txt
lpr: cMP495: unknown printer
It is baffles me because, from all of the readout and settings from the CUPS web interface, it appears to be setup correctly. I thought maybe I did not install a needed package. But I've done aptitude build-dep cups as well as some other utilities for handling print jobs. So everything needed should have installed.
 
Old 04-04-2011, 08:16 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
It might be possible that your lpr is the BSD printer spooler and not the cups-lpr wrapper.
Look at the output of the command:
dpkg -s cups-bsd
dpkg -s cups-client

Last edited by michaelk; 04-04-2011 at 08:19 PM.
 
1 members found this post helpful.
Old 04-04-2011, 11:36 PM   #12
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
On another note, I did notice that when I print from the command line on my laptop it says (stdin) instead of (standard input), which appears on the server's job queue.

And here is some output below... from what I see below, you are right about it being the BSD version (I could be wrong).
Code:
root@server:# dpkg -s cups-bsd
Package `cups-bsd' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
Code:
root@server:# dpkg -s cups-client
Package: cups-client
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 480
Maintainer: Debian CUPS Maintainers <pkg-cups-devel@lists.alioth.debian.org>
Architecture: i386
Source: cups
Version: 1.4.4-7
Depends: libc6 (>= 2.4), libcups2 (>= 1.4.0), libcupsimage2 (>= 1.4.0), zlib1g (>= 1:1.2.3.3.dfsg), cups-common (>= 1.4.4), adduser
Suggests: cups, kdeprint, gtklp, cups-pt, xpp, cups-bsd
Conflicts: lprng
Description: Common UNIX Printing System(tm) - client programs (SysV)
 The Common UNIX Printing System (or CUPS(tm)) is a printing system and
 general replacement for lpd and the like.  It supports the Internet
 Printing Protocol (IPP), and has its own filtering driver model for
 handling various document types.
 .
 This package provides the System V style print client programs.
I also got curious and ran this too (checkout the red text below):
Code:
root@server:# dpkg -s lpr
Package: lpr
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 400
Maintainer: Adam Majer <adamm@zombino.com>
Architecture: i386
Version: 1:2008.05.17
Replaces: logcheck-database
Depends: libc6 (>= 2.7-1), netbase
Suggests: magicfilter | apsfilter, gs
Conflicts: suidmanager (<< 0.50)
Conffiles:
 /etc/logcheck/ignore.d.server/lpr 74b2c368d40e723c8bab38d048246131
 /etc/default/lpd 9b883786cf372c34999ff8e9ac0efd70
 /etc/init.d/lpd 9691cb1031e389e6b0c0e9a6b94a4c22
 /etc/cron.weekly/lpr 3573da7a7ab9e260c53a79831d80d280
Description: BSD lpr/lpd line printer spooling system
 This is the BSD printer spooler and associated utilities.
 You can use this for local and remote printers.
 .
 If you install magicfilter or apsfilter (along with ghostscript),
 lpr will be able to automatically handle special file types
 (such as Postscript and PDF files).
So I need to remove lpr and use lprng?
Code:
root@server:# apt-cache search lpr | grep spool
lpr - BSD lpr/lpd line printer spooling system
lprng-doc - lpr/lpd printer spooling system (documentation)
lprng - lpr/lpd printer spooling system

Last edited by flipjarg; 04-05-2011 at 12:32 AM. Reason: added lpr readout
 
Old 04-05-2011, 03:57 PM   #13
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Hmmmm.... I am thinking of removing lpr and installing lprng... but because of deps I get the below code. Any suggestions?

Code:
root@server:# aptitude install lprng
The following NEW packages will be installed:
  lprng{b} 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,155 kB of archives. After unpacking 2,867 kB will be used.
The following packages have unmet dependencies:
  cups-client: Conflicts: lprng but 3.8.A-3 is to be installed.
  lprng: Conflicts: lpr but 1:2008.05.17 is installed.
The following actions will resolve these dependencies:

      Remove the following packages:                              
1)      cups                                                      
2)      cups-client                                               
3)      cups-driver-gutenprint                                    
4)      lpr                                                       

      Leave the following dependencies unresolved:                
5)      foomatic-db-engine recommends cups                        
6)      foomatic-db-engine recommends cups-client                 
7)      foomatic-db recommends cups                               
8)      foomatic-db recommends cups-client                        
9)      foomatic-filters recommends cups | enscript | a2ps | mpage
10)     ghostscript-cups recommends cups                          
11)     ghostscript-cups recommends cups-client                   
12)     hpijs recommends cups                                     
13)     hpijs recommends cups-client                              
14)     min12xxw recommends cups                                  


Accept this solution? [Y/n/q/?]

Last edited by flipjarg; 04-05-2011 at 04:00 PM.
 
Old 04-05-2011, 06:30 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
AFAIK cups-bsd replaces lpr. I do not think lprng is what you want.
 
1 members found this post helpful.
Old 04-05-2011, 07:53 PM   #15
flipjarg
Member
 
Registered: May 2010
Distribution: Debian & Backtrack
Posts: 58

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by michaelk View Post
AFAIK cups-bsd replaces lpr. I do not think lprng is what you want.
Do think it is odd that I was able to set the printer as shared on the server and use my laptop to print on the shared version of the printer?

When I printed on the shared version of the printer, through the server, I imagine CUPS on the laptop processed the print job, not CUPS on the server. Right?

I am thinking of just starting over again, uninstall (purge) and re-install cups.
 
  


Reply

Tags
command line, printing


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
Command line printing phonecian Linux - Software 1 08-13-2006 09:41 AM
Printing from command line noeffred Ubuntu 3 08-12-2006 02:26 PM
Command Line Printing lasalsademuerte Linux - General 1 02-18-2006 04:38 PM
command line printing rb3ng Linux - Newbie 3 04-22-2004 01:35 PM
Command line printing? HappyDude Linux - Software 2 10-25-2003 02:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration