Technical article 126532

How to add a CUPS printer using the lpadmin command line instead of the CUPS GUI (web) interface?

OpenServer 6.0.0OpenServer 5.0.7UnixWare 7.1.3UnixWare 7.1.4

Written · Last revised

Problem

How can I add a CUPS printer to my system using the command line instead of the CUPS GUI interface on:

http://localhost:631

Solution

For UnixWare 7.1.4 MP3 CUPS (ver 1.1.19-03), make sure you have installed the latest Foomatic package " Foomatic Filters and PPDs" (ver 3.0.2) and hpijs package "HP Inkjet Printer Driver" (1.5-02).

In this example, we will add two printers, one an HP LaseJet 9000 (PS) network printer and the other an HP DeskJet 5500 that is attached locally to the server via the parallel port.

It is assumed that CUPS is the default printing subsystem. For details on how to change your default printing subsystem please see

TA# 126336:"How can I change my printing subsystem between CUPS and SYSV on SCO Unix?"

- For the HP LaserJet 9000 (PS) Network printer:

# cd /usr/share/cups/model/foomatic-ppds/HP
# cp HP-LaserJet_9000-ljet4.ppd.gz /usr/share/cups/model
# gzip -d /usr/share/cups/model/HP-LaserJet_9000-ljet4.ppd.gz
# lpadmin -p HP-LJ9000 -E -v socket://192.168.0.11:9100/
          -m HP-LaserJet_9000-ljet4.ppd
# lpstat -t (To check the added printer status)

Please note: The 9100 in the "socket://192.168.0.11:9100" is the HP JetDirect Port Number.

Also note that the models are in /usr/share/cups/model.

- For the HP DeskJet 5500 parallel port printer:

# cd /usr/share/cups/model/foomatic-ppds/HP
# cp HP-DeskJet_5550-hpijs.ppd.gz /usr/share/cups/model
# gzip -d /usr/share/cups/model/HP-DeskJet_5550-hpijs.ppd.gz
# lpadmin -p HP-DJ5500 -E -v parallel:/dev/lp0
          -m HP-DeskJet_5550-hpijs.ppd
# lpstat -t (To check the added printer status)

Please note: From man lpadmin(8) -p Printer Name -E Enables the printer and accepts jobs -m Printer Model Name -v Sets the device-uri attribute of the printer queue.

For a list of possible device URIs run the command:

lpinfo -v

For network type connection, the following types of URI are valid:

socket://
http://
ipp://
lpd://

For Direct Parallel Port , Serial COM1 & COM2 connection the following types of URI are valid:

parallel:/dev/lp0
serial:/dev/tty00?baud=115200
serial:/dev/tty01?baud=115200
You can find more information at: http://www.cups.org/documentation.php

NOTE: To add new PPD printer definitions, add the PPD files to:

/usr/share/cups/model/foomatic-ppds/

For example, create a folder called "Lexmark" then add the gzipped compressed file there then restart CUPS and it should then be detected.

From the Xinuos technical article database, record 126532. Reproduced with permission. The original is at www.sco.com/ta/126532, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.