Configuring and Managing Printing in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Set Up a Printer by Using the lpadmin Command

  1. Connect the printer to the system, then turn on the power to the printer.

    Consult the printer vendor's installation documentation for information about hardware switches and cabling requirements.

  2. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2

  3. Use the lpadmin command with the –p option to add a printer to CUPS.

    Only the most commonly used options of the CUPS lpadmin command are shown here. For information about other options, see the lpadmin(8) man page.

    $ /usr/sbin/lpadmin -p printer-name -E -v device -
    
    P 
    
    full path to ppd file
    –p

    Specifies the name of the printer to add.

    –E

    Enables the destination and accepts jobs.

    –v

    Sets the device-uri attribute of the print queue.

    –P

    Specifies a PPD (Postscript Printer Description) file to use with the printer. The following are standard locations of PPD files:

    • /usr/share/cups/model/foomatic-db-ppds/manufacturer name

    • /usr/share/cups/model/SUNWhplip

    • /usr/share/ppd/SUNWhpijs/HP

    See the examples at the end of this procedure.

  4. (Optional) If you are not using the lpadmin command with the –E option, enable the printer to accept print requests and to print those requests.
    $ cupsaccept printer-name
    $ cupsenable printer-name
  5. Verify that the printer is correctly configured.
    $ lpstat -l -p printer-name
Example 2-1  Adding a Printer That Uses a PPD File

This example shows how to add an HP LaserJet printer LaserJet by using a JetDirect network interface with the IP address 10.1.1.1.

$ /usr/sbin/lpadmin -p LaserJet -E -v socket://10.1.1.1 \
-P /usr/share/ppd/SUNWhpijs/HP/hp-laserjet_p4515-ps.ppd.gz

Once a printer is configured, a copy of the PPD file is placed in the /etc/cups/ppd directory and renamed to queue-name.ppd. To find the path this copy of the PPD file, type the following command:

# lpstat -l -p queue-name
Example 2-2  Adding a Printer That Is Connected to the Parallel Port

This example shows how to add an HP DeskJet printer DeskJet that is connected to the parallel port . This example assumes that the PPD file is in the /usr/share/cups/model directory.

$ /usr/sbin/lpadmin -p DeskJet -E -v parallel:/dev/lp1 -m 

drv:///sample.drv/

deskjet.ppd
–m

Sets a PPD file for the printer

deskjet.ppd

PPD file for the HP DeskJet drivers included with CUPS

Example 2-3  Adding a Printer That Is Connected to the Serial Port

This example shows how to add a dot matrix printer that is connected to the serial port. This example assumes that the PPD file is in the /usr/share/cups/ model directory.

$/usr/sbin/lpadmin -p DotMatrix -E -m epson9.ppd \


-v serial:/dev/ttyS0?baud=9600+size=8+parity=none+flow=soft

Specify the serial port, baud rate, number of bits, parity, and flow control. If you do not need flow control, delete the +flow=soft attribute.