LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Printing from Command Line won't work - just sits in print queue (https://www.linuxquestions.org/questions/linux-newbie-8/printing-from-command-line-wont-work-just-sits-in-print-queue-872743/)

flipjarg 04-03-2011 02:45 PM

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


flipjarg 04-03-2011 05:57 PM

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.

michaelk 04-03-2011 06:16 PM

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

bigrigdriver 04-03-2011 06:17 PM

Here's a tutorial that might help: http://www.debiantutorials.org/debia...linux-etch-228.

flipjarg 04-03-2011 06:32 PM

Quote:

Originally Posted by michaelk (Post 4312781)
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 (Post 4312782)
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.

michaelk 04-03-2011 06:55 PM

Ok look at the output and post the info for your printer:
localhost:631/printers

flipjarg 04-03-2011 06:59 PM

Quote:

Originally Posted by michaelk (Post 4312802)
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


flipjarg 04-03-2011 08:20 PM

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.

michaelk 04-03-2011 08:50 PM

At first glance looks ok. What happens when you try:
lpr -P cMP495 test.txt

flipjarg 04-04-2011 06:15 PM

Quote:

Originally Posted by michaelk (Post 4312889)
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.

michaelk 04-04-2011 07:16 PM

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

flipjarg 04-04-2011 10:36 PM

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


flipjarg 04-05-2011 02:57 PM

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/?]


michaelk 04-05-2011 05:30 PM

AFAIK cups-bsd replaces lpr. I do not think lprng is what you want.

flipjarg 04-05-2011 06:53 PM

Quote:

Originally Posted by michaelk (Post 4315080)
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.


All times are GMT -5. The time now is 01:46 AM.