I have a USB printer, connected to a network print server (TL-PS310U).

I want to print from Debian/Ubuntu to this printer. The queue is named 2409ee3c, but when I try to use lpr, it says that I need to add /version=1.1:

user@user:~$ lpr -H -P prt0 C0003022.che.spl 
lpr: Error - add '/version=1.1' to server name.

Then I added the printer in CUPS (http://localhost:631) as lpd, with name Printserver:


And I now can print with LPR:

user@user:/run/shm$ export CUPS_SERVER=localhost:631; lpr -H -P 2409ee3c C0003022.che.spl 
lpr: The printer or class does not exist.
jsivil@jsivil:/run/shm$ export CUPS_SERVER=localhost:631; lpr -H -P Printserver C0003022.che.spl 

My questions are:

1) Can I print with LPR directly to this printer behind a printserver? (I've tried netcat but it doesn't work for this printserver)

2) Does LPR need CUPS? Is it OK to use

3) How can I avoid having to export the CUPS_SERVER variable prior to use lpr?



netcat could be used, though you'd need to send appropriate LPD commands over it. rlpr is doubtless a better option for direct printing than figuring out how to do RFC 1179 over netcat.

The CUPS lpr client does need a CUPS server, as the CUPS server does the heavy work, and the client portion is mostly just a compatibility shim for the traditional lpr or lp command line interfaces.

CUPS has a ~/.cups configuration directory that might be used instead of an environment variable, though I do not recall needing to set CUPS_SERVER where the print server was on the local system:

% ls ~/.cups/           
% cat ~/.cups/lpoptions          
Default ps307g
  • I didn't know of rlpr, seems to do the job. Thanks – JorgeeFG Mar 18 '16 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.