System Administration Guide: Advanced Administration

How to Add a New Attached Printer by Using LP Print Service Commands

The following procedure describes how to add a new attached printer with the expanded printer support that is available in this release. The -n option to the lpadmin command enables you to specify a PPD file when adding a new attached printer or modifying an existing attached printer. Two examples follow this procedure. The first example shows you how to add a new attached printer with PPD files. The second example shows you how to add a new attached printer without PPD files.

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

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

  2. Collect the information that is required to configure an attached printer with PPD files.

    • Printer name and port device

    • File content type

    • PPD file

      To determine the PPD file that the printer will use, first define the printer make, model, and driver.

      For overview information about using PPD files when adding a printer or modifying an existing printer by using LP print service commands, see What's New in Printing?.

  3. Define the printer name, port device, file content type, and PPD file that the printer will use.

    When using PPD files, the file content type is usually PostScript.

    1. Specify the printer name and the port device that the printer will use.


      # lpadmin -p printer-name -v /dev/printers/0
      

      The device to use is /dev/printers/0.

    2. Specify the interface script that the printer will use.


      # lpadmin -p printer-name -m standard_foomatic
      
    3. Specify the file content type and the PPD file that the printer will use.


      # lpadmin -p printer-name -I content-type  -n 
      /usr/lib/lp/model/ppd/manufacturer/ppdfile 
      

      The PPD file that you supply is located in the /usr/lib/lp/model/ppd/manufacturer directory.

    4. Specify the printer description.


      # lpadmin -p printer-name -D "printer-description"
      

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

  4. (Optional) Add filters to the print server.


    # cd /etc/lp/fd
    # for filter in *.fd;do
        > name=`basename $filter .fd`
        > lpfilter -f $name -F $filter
        > done
    
  5. Enable the printer to accept print requests and to print those requests.


    # accept printer-name
    # enable printer-name
    
  6. Verify that the printer is correctly configured.


    # lpstat -p printer-name
    

    The output of the lpstat command will list the PPD file that you used.

Example—Adding a New Attached Printer With PPD Files by Using LP Print Service Commands

This example shows how to add a new attached printer with PPD files. The -n option to the lpadmin command enables you to add a new print queue by specifying PPD files. The following information is used as an example. The information that you provide will vary:


# lpadmin -p paper -v /dev/printers/0 1
# lpadmin -p paper -I postscript 2
# lpadmin -p paper -m standard_footmatic 3
# lpadmin -p paper -n /usr/lib/lp/model/ppd/Lexmark/ \
Lexmark-Optra_E312-Postscript.ppd.gzmake4
# lpadmin -p paper -D "Color printer on third floor, rm 3003" 5
# cd /etc/lp/fd
# for filter in *.fd;do 
   > name=`basename $filter .fd`
   > lpfilter -f $name -F $filter 
   > done 6
# accept paper
	destination “paper” now accepting requests 
# enable paper	7 
printer “paper” now enabled 
# lpstat -p paper 8
printer paper is idle. enabled since Feb 28 11:21 2004. available. 
  1. Defines the printer name and the port device that the printer will use

  2. Sets the file content types to which the printer can print to directly

  3. Specifies the interface script for utilizing PPD files

  4. Specifies the PPD file

  5. Adds a description for the printer

  6. Adds print filters to the print server

  7. Accepts print requests for the printer and enables the printer

  8. Verifies that the printer is ready for printing

Example—Adding a New Attached Printer Without PPD Files by Using LP Print Service Commands

This example shows how to add a new attached printer without PPD files. The commands in this example must be executed on the print server where the printer is connected. The following information is used as an example. The information that you provide will vary:

  1. Gives lp ownership and sole access to a port device

  2. Defines the printer name and the port device that the printer will use

  3. Sets the printer type of the printer

  4. Specifies the file content types to which the printer can print directly

  5. Adds a description for the printer

  6. Adds print filters to the print server

  7. Accepts print requests for the printer and enables the printer

  8. Verifies that the printer is ready

Where to Go From Here

Use the following table to determine which tasks to complete next.

Task 

For More Information 

Add access to the newly installed printer on the print clients because you did not add the printer information to the name service database. 

How to Add Printer Access by Using Solaris Print Manager

Set up a .printers file.

How to Set Up a .printers File