Running "lp*" commands in RHEL results in "Connection refused," "Transport endpoint not connected," or "Bad file descriptor"

Solution Verified - Updated -

Issue

  • Running the lpadmin command to try and add a printer results in the following:

    # lpadmin -h localhost -p laser -v lpd://10.1.2.3/xerox_printer
    lpadmin: Unable to connect to server: Connection refused
    
  • In RHEL 8, Running lpadmin to list the printers on a remote CUPS server results in the following:

    $ lpstat -h rhel810-master -a
    lpstat: Bad file descriptor
    

    This also occurs if "ServerName rhel810-master" is added to /etc/cups/client.conf or the environment variable SERVER_NAME is set to rhel810-master.

  • Running lpinfo results in the error "Transport endpoint is not connected":

    [root@lnx001 ~]# lpinfo -m
    lpinfo: Transport endpoint is not connected
    
  • Running any CUPS command (lpadmin, lpstat, lp) results in "Connection refused"

Environment

  • Red Hat Enterprise Linux (RHEL), all versions
  • Common Unix Printing System (CUPS), all versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content