lp filename yields "cannot open connection to localhost - Connection refused"
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
lp filename yields "cannot open connection to localhost - Connection refused"
I am using CUPS on Slackware. When I try to print from a shell, using lp or lpr, I get:
cannot open connection to localhost - Connection refused
Make sure the remote host supports the LPD protocol
and accepts connections from this host and from non-privileged (>1023) ports
Waiting 10 seconds before retry
But localhost is reachable (ping and telnet work). I can also print from KDE applications, but not from shell!
Is it one specific file, or any file that you try to print from a shell? Also, I have had problems in the past when I have had the lpd service started and CUPS started...it didn't work...so you may want to verify that.
Most likely you also installed lprng when you installed CUPS in Slackware. Run removepkg on the lprng package (see /var/log/packages to see if you have installed the lprng package). If it's there, that is probably the problem. After you have removed lprng, you will probably need to reinstall CUPS and perhaps reinstall your printer again. Under CUPS, lpr is a symbolic link to lpr-cups. If you have installed lprng on top of CUPS, the symbolic link doesn't exist and you are actually running the lpr that is part of lprng rather than lpr-cups.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.