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 -vFor 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=115200You can find more information at: http://www.cups.org/documentation.phpNOTE: 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.