I would like to know how to print with lp commands without using CUPS.

If I send a file to print with this command:

cat fichero.txt | lpr

I've got this error:

lpr cannot open connection to localhost

How can I print or config my system to print using lp commands?


In Ubuntu, there are several packages providing /usr/bin/lpr, one of which is cups-bsd. If you install an alternative you should be able to print without cups. On Redhat-based distros the command you can use to find packages providing a binary is yum whatprovides.

➜  ~ apt-file search /usr/bin/lpr
cups-bsd: /usr/bin/lpr
cups-bsd: /usr/bin/lprm
dvi2ps: /usr/bin/lprdvi
lpr: /usr/bin/lpr
lpr: /usr/bin/lprm
lprng: /usr/bin/lpr
lprng: /usr/bin/lprm
  • I have installed cups-bsd and If I try to print with cat file.txt | lpr I've got this error: lpr: Error - the task scheduler program does not respond. – José Carlos Aug 29 '18 at 11:17
  • But you said you didn't want CUPS - maybe try "lpr" or "lprng"? – GDR Sep 4 '18 at 6:58
  • lpr and lprng doesn't work to me :( – José Carlos Sep 4 '18 at 8:18

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.