JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Configuring and Managing Printing in Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Setting Up and Administering Printers by Using CUPS (Overview)

2.  Setting Up Printers by Using CUPS (Tasks)

Setting Up Your Printing Environment to Work With CUPS

How to Set Up Your Printing Environment

Setting Up Your Printing Environment for an Upgrade

Setting Up Printers by Using CUPS Command-Line Utilities (Task Map)

Setting Up and Administering Printers by Using CUPS Command-Line Utilities

CUPS Command-Line Utilities

How to Set Up a Printer by Using the lpadmin Command

Setting a Default Printer

How to Set a Default Printer at the Command Line

How to Print to a Specified Printer

How to Verify the Status of Printers

How to Print a File to the Default Printer

How to Delete a Printer and Remove Printer Access

Setting Up Network Printers by Using CUPS Commands

How to Add a Network Printer on a Different Subnet by Using CUPS Commands

How to List the Available Drivers and Devices

Setting Up and Administering Printers by Using the CUPS Web Browser Interface (Task Map)

Setting Up and Administering Printers by Using the CUPS Web Browser Interface

Requirements for Using the CUPS Web Browser Interface

Troubleshooting Issues With Accessing the CUPS Web Browser Interface

Print Administration Tasks

About the Administration Tab

About the Printers Tab

How to Add a New Printer

About the CUPS Print Manager GUI

Starting CUPS Print Manager

Setting Up Printers by Using CUPS Print Manager (Task Map)

Setting Up Printers by Using CUPS Print Manager

Local Server Configuration

Remote Server Configuration

How to Configure CUPS to Administer Remote Print Queues

Selecting a Print Device

How to Set Up a New Local Printer

3.  Administering Printers by Using CUPS Print Manager (Tasks)

Index

Setting Up and Administering Printers by Using CUPS Command-Line Utilities

This section provides a brief description of the CUPS commands and describes how to set up and administer your printers.

CUPS Command-Line Utilities

CUPS provides various commands to set up printers and make those printers accessible to systems on the network. In addition, CUPS supports several printer-specific options that enable you to control printer configuration. The following table lists frequently used CUPS commands.


Note - Some CUPS command names are the same as legacy LP print commands, but the behavior of commands under CUPS management might be different.


Table 2-1 CUPS Command-Line Utilities

Command
Task
cancel(1)
Cancels a print request
cupsaccept(8)
Enables queueing of print requests to the named destinations
cupsdisable(8)
Disables the named printers or classes
cupsenable(8)
Enables the named printers or classes
cupsreject(8)
Rejects queueing of print requests to the named destinations
lp(1)
Submits a print request
lpadmin(8)
Sets up or changes a printer or class configuration
lpc(8)
Provides limited control over CUPS print and class queues
lpinfo(8)
Shows available devices or drivers known to the CUPS server
lpmove(8)
Moves a specified job or all jobs to a new destination
lpoptions(1)
Displays or sets printer options and defaults
lpq(1)
Shows the current print queue status
lpr(1)
Submits a print request
lprm(1)
Cancels print jobs that have been queued for printing
lpstat(1)
Displays the status information for queues and requests

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 How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services

  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.

Setting a Default Printer

You can specify the default printer in one of the following ways:

The print command searches for the default printer in the following order:

  1. The printer name as set by the lp command with the -d option

  2. The value of the LPDEST environment variable

  3. The value of the PRINTER environment variable

  4. The printer name as set by the lpoptions command

  5. The printer name as set by the lpadmin command

For instructions on setting up printers by using the CUPS web browser interface, see Setting Up and Administering Printers by Using the CUPS Web Browser Interface .

How to Set a Default Printer at the Command Line

The default printer can be a local printer or a remote printer.

  1. Set the user's default printer by using one of the following methods:
    • By specifying the PRINTER variable:
      $ export PRINTER=printer-name

      where printer-name specifies the name of the printer to be assigned as the user's default printer.


      Note - When using the lp command with the -d option, the destination printer, which might not be the default printer, is specified. If the -d option is not specified, the print command searches for information about the printer in the PRINTER environment variable.


    • By specifying the LPDEST variable:
      $ export LPDEST=printer-name

      where printer-name specifies the name of the printer to be assigned as the default printer.


      Note - If both the LPDEST and the PRINTER environment variables are set, LPDEST takes precedence.


    • By using the lpoptions command:
      $ lpoptions -d printer-name
      -d

      Specifies the destination printer.

      printer-name

      Specifies the name of the printer that is assigned as the user's default printer.

      For more information, see the lpoptions(1) man page.

  2. Verify the default printer.
    $ lpstat -d
  3. To print to the default printer, type the following command:
    $ lp filename

Example 2-4 Setting a Default Printer by Specifying the PRINTER Variable

The following example shows how to set the printer luna as the default printer by using the PRINTER variable.

$ export PRINTER=luna
$ lpstat -d
system default destination: luna

Example 2-5 Setting a Default Printer by Specifying the LPDEST Variable

The following example shows how to set the printer luna as the default printer by specifying the LPDEST variable.

$ export LPDEST=luna
$ lpstat -d
system default destination: luna

Example 2-6 Setting a Default Printer by Using the lpoptions Command

The following example shows how to set the printer luna as the default printer. The printer luna is used as the default printer if the LPDEST or the PRINTER environment variable is not set.

$ lpoptions -d luna
$ lpstat -d
system default destination: luna

The lpoptions command creates a ~/.cups/lpoptions file that includes an entry for the default printer luna in the file. By default, all print jobs are now directed to the luna printer. For a root user, the lpoptions command creates a /etc/cups/lpoptions file.

Example 2-7 Setting a Default Printer by Using the lpadmin Command

The following example shows how to set the printer luna as the default printer by using the lpadmin command.

$ lpadmin -d luna
$ lpstat -d
system default destination: luna

How to Print to a Specified Printer

  1. (Optional) Verify the status of the printer.
    $ lpstat -p printer-name
  2. Provide the destination printer name when issuing the lp command.
    $ lp -d destination-printer filename
    -d

    Specifies the destination printer.

    destination-printer

    Specifies the name of the printer that you are assigning as the destination printer.

    filename

    Specifies the file name to print.


    Note - You can also use the lpr command with the -P option to submit a print request to a specific printer. For more information, see the lpr(1) man page.


Example 2-8 Printing to a Specified Printer by Using the lp Command

The following example shows how to set the printer luna as the destination printer.

$ lp -d luna abc.ps
request id is luna-1 (1 file(s))

$ lpstat -d
system default destination: saturn

The -d option of the lp command takes precedence over default printer settings.

Note that in this example, the default printer is saturn.

How to Verify the Status of Printers

The lpstat command displays information about accessible printers and jobs.

  1. Log in to any system on the network.
  2. (Optional) Verify the status of all printers or a specific printer.

    Only the most commonly used options are shown here. For information about other options, see the lpstat(1) man page.

    $ lpstat [-d] [-l] [-p] printer-name [-t]
    -d

    Shows the default printer.

    -p printer-name

    Shows that a printer is active or idle, and when the printer was enabled or disabled.

    You can specify multiple printer names with this command. Use a space or a comma to separate printer names. If you use spaces, enclose the list of printer names in quotation marks. If you do not specify printer-name, the status of all printers is displayed.

    -l

    Shows the characteristics of printers and jobs.

    -t

    Shows status information about CUPS, including the status of all printers, for example whether printers are active and accepting print requests.

Example 2-9 Displaying the Status of Printers

To display the status of the printer luna:

$ lpstat -p luna
printer luna is idle. enabled since Jul 12 11:17 2011. available.

To display the system's default printer:

$ lpstat -d
system default destination: luna

To display the description of the printers asteroid and luna:

$ lpstat -p "asteroid, luna" -D
printer asteroid faulted. enabled since Jan 5 11:35 2011. available.
unable to print: paper misfeed jam

Description: Printer by break room
printer luna is idle. enabled since Jan 5 11:36 2011. available.
Description: Printer by server room.

To display the characteristics of the printer luna:

$ lpstat -l -p luna
printer luna is idle.  enabled since September 29, 2011 05:20:57 PM BST
Form mounted:
Content types: any
Printer types: unknown
Description: luna
Alerts: none
Location: 
Connection: direct
On fault: no alert
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner required
Charset sets:
(none)
Default pitch:
Default page size:
Default port settings:

How to Print a File to the Default Printer

  1. Log in to any system on the network.
  2. (Optional) Verify the status of the printer.
    $ lpstat -p printer-name
  3. Issue a print request in one of the following ways:
    • By using the lp command:
      $ lp filename
    • By using the lpr command:
      $ lpr filename

    Note - Only the basic commands are shown in this procedure. For information about the other options, see the lp(1) and the lpr(1) man pages.


How to Delete a Printer and Remove Printer Access

  1. Become an administrator on a print client with access to the printer to delete.
  2. On the system that is the print client, delete information about the printer.
    $ lpoptions -x printer-name
    printer-name

    Specifies the name of the printer to delete.

    -x

    Deletes the specified printer.


    Note - The -x option only removes the default options for a specific printer and instance. The original print queue still remains until it is deleted by using the lpadmin command.


  3. Become an administrator.
  4. On the system that is the printer server, stop accepting print requests for the printer.
    $ cupsreject printer-name

    This step prevents any new requests from entering the printer's queue while you are in the process of removing the printer.

  5. Stop the printer.
    $ cupsdisable printer-name
  6. Delete the printer.
    $ lpadmin -x printer-name
  7. Verify that the printer has been deleted, as follows:
    1. Confirm that the printer has been deleted on the print client.
      $ lpstat -l -p printer-name

      The command output displays a message indicating the printer does not exist.

    2. Confirm that the printer has been deleted on the print server.
      $ lpstat -l -p printer-name

      The command output displays a message indicating that the printer does not exist.

Example 2-10 Deleting a Printer

The following example shows how to delete the printer luna from the print client terra and from the print server jupiter.

terra# lpoptions -x luna
terra# lpstat -l -p luna
jupiter# lpadmin -x luna
jupiter# lpstat -l -p luna
lpstat: Invalid destination name in list "luna"!

Setting Up Network Printers by Using CUPS Commands

A network printer is a hardware printing device that is connected directly to a network. A network printer has its own system name and IP address.

CUPS automatically discovers printers that are identified in the same subnet. Network printers that are not in the same subnet have to be added manually by the system administrator. You can configure a network printer by using the lpadmin command.

How to Add a Network Printer on a Different Subnet by Using CUPS Commands

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

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

  2. Ping the network printer from your system.
    # ping ip-address-of-network-printer
  3. Determine the make and model of the network printer.
    # lpinfo --make-and-model printer manufacturer name

    For example, to list the Xerox printers:

    # lpinfo --make-and-model Xerox -m

    For more information, see How to List the Available Drivers and Devices.

  4. Use the lpadmin command to add the network printer.
    # lpadmin -p printer-name -E -v socket://ip-address-of-network-printer \
    -m printer-make-and-model
    -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.

    -m

    Sets the PPD file for the printer from the model directory or by using one of the driver interfaces.

    For information, see the lpadmin(8) man page.

  5. Verify that the printer is correctly configured.
    # lpstat -l -p printer-name

Example 2-11 Adding a Network Printer That Is on a Different Subnet

The following example shows how to add the Xerox printer luna that is on a different subnet with IP address 10.178.236.21:

# ping 10.178.236.21
10.178.236.21 is alive

# lpinfo --make-and-model Xerox -m
foomatic:Xerox-2700_XES-xes.ppd Xerox 2700 XES Foomatic/xes
foomatic:Xerox-3700_XES-xes.ppd Xerox 3700 XES Foomatic/xes
foomatic:Xerox-4045_XES-xes.ppd Xerox 4045 XES Foomatic/xes
foomatic:Xerox-Phaser_5500DN-Postscript.ppd Xerox Phaser 5500DN Foomatic/Postscript\
gutenprint.5.2://xerox-able_1406/expert 

# lpadmin -p luna -E -v socket://10.178.236.21 \
-m foomatic:Xerox-Phaser_5500DN-Postscript.ppd

# lpstat -l -p luna
printer luna is idle.  enabled since June 25, 2012 12:13:05 PM IST
printer luna is idle.  enabled since September 29, 2011 05:20:57 PM BST
Form mounted:
Content types: any
Printer types: unknown
Description: luna
Alerts: none
Location: 
Connection: direct
On fault: no alert
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner required
Charset sets:
(none)
Default pitch:
Default page size:
Default port settings:

How to List the Available Drivers and Devices

The lpinfo command lists the available devices and drivers known to the CUPS server.

  1. Log in to any system on the network.
  2. List the available devices and drivers by using the lpinfo command.
    • Use the -m option to list the available drivers.
      # lpinfo -m
    • Use the -v option to list the available devices.
      # lpinfo -v

Example 2-12 Listing the Available Drivers

To list all Xerox printers:

# lpinfo --make-and-model Xerox -m
foomatic:Xerox-2700_XES-xes.ppd Xerox 2700 XES Foomatic/xes
foomatic:Xerox-3700_XES-xes.ppd Xerox 3700 XES Foomatic/xes
foomatic:Xerox-4045_XES-xes.ppd Xerox 4045 XES Foomatic/xes
gutenprint.5.2://xerox-able_1406/expert 
Xerox Able 1406 - CUPS+Gutenprint v5.2.4
gutenprint.5.2://xerox-able_1406/simple 
Xerox Able 1406 - CUPS+Gutenprint v5.2.4 Simplified