Skip Navigation Links | |
Exit Print View | |
Configuring and Managing Printing in Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library |
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
How to Set Up a Printer by Using the lpadmin Command
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
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
About the CUPS Print Manager GUI
Setting Up Printers by Using CUPS Print Manager (Task Map)
Setting Up Printers by Using CUPS Print Manager
How to Configure CUPS to Administer Remote Print Queues
How to Set Up a New Local Printer
3. Administering Printers by Using CUPS Print Manager (Tasks)
This section provides a brief description of the CUPS commands and describes how to set up and administer your printers.
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
|
Consult the printer vendor's installation documentation for information about hardware switches and cabling requirements.
For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services
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
Specifies the name of the printer to add.
Enables the destination and accepts jobs.
Sets the device-uri attribute of the print queue.
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.
$ cupsaccept printer-name $ cupsenable printer-name
$ 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
Sets a PPD file for the printer
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.
You can specify the default printer in one of the following ways:
By setting the LPDEST or PRINTER environment variable.
The LPDEST environment variable determines the destination of the printer. If the LPDEST variable is not set, the PRINTER variable is used. The PRINTER variable determines the output device or destination.For instructions on setting up a default printer by specifying the environment variables, see How to Set a Default Printer at the Command Line.
By using the new lpoptions command.
Use this command to display or set printer options and defaults. For instructions on setting up a default printer by using the CUPS commands, see How to Set a Default Printer at the Command Line. For more information, see the lpoptions(1) man page.
By using the lpadmin command.
The print command searches for the default printer in the following order:
The printer name as set by the lp command with the -d option
The value of the LPDEST environment variable
The value of the PRINTER environment variable
The printer name as set by the lpoptions command
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 .
The default printer can be a local printer or a remote printer.
$ 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.
$ 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.
$ lpoptions -d printer-name
Specifies the destination printer.
Specifies the name of the printer that is assigned as the user's default printer.
For more information, see the lpoptions(1) man page.
$ lpstat -d
$ 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
$ lpstat -p printer-name
$ lp -d destination-printer filename
Specifies the destination printer.
Specifies the name of the printer that you are assigning as the destination printer.
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.
The lpstat command displays information about accessible printers and jobs.
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]
Shows the default printer.
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.
Shows the characteristics of printers and jobs.
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:
$ lpstat -p printer-name
$ lp filename
$ 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.
$ lpoptions -x printer-name
Specifies the name of the printer to delete.
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.
$ 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.
$ cupsdisable printer-name
$ lpadmin -x printer-name
$ lpstat -l -p printer-name
The command output displays a message indicating the printer does not exist.
$ 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"!
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.
Consult the printer vendor's installation documentation for information about hardware switches and cabling requirements.
# ping ip-address-of-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.
# lpadmin -p printer-name -E -v socket://ip-address-of-network-printer \ -m printer-make-and-model
Specifies the name of the printer to add.
Enables the destination and accepts jobs.
Sets the device-uri attribute of the print queue.
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.
# 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:
The lpinfo command lists the available devices and drivers known to the CUPS server.
# lpinfo -m
# 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