System Administration Guide

How to Add a Local Printer Using LP Commands

Adding a local printer may also be accomplished using the command line interface.

  1. Select the system which is to be the printer server.

    Verify that the print server has the following print packages installed by using the pkginfo command: SUNWpcr, SUNWpcu, SUNWpsr, SUNWpsu, SUNWscplp, and SUNWpsf.


    # pkginfo package_instance
    
  2. Connect the printer to the printer server and turn on the power to the printer.

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

  3. Set lp ownership and read/write access on the port device.


    # chown lp /dev/term/device
    # chmod 600 /dev/term/device
    
  4. Define the printer name, the device, the printer type and content type by using the lpadmin command.

    1. Define the printer name and the port device the printer will use.


      # lpadmin -p printer-name -v /dev/term/device 
      
    2. Set the printer type of the printer.


      # lpadmin -p printer-name -T printer-type 
      
    3. Specify the file content types of the printer.


      # lpadmin -p printer-name -I content-type
      
  5. Add filters to the print server by using the lpfilter command

    1. First, determine if the needed filters are installed.


      #	lpfilter -l -f all 
      

      If the filter is not installed, you will see the message:


      ERROR: No filter by the name "" exists.
    2. If you have determined that filter installation is needed, use the lpfilter command to install the filters.


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


    #	accept printer-name
    #	enable printer-name
     
    
  7. Verify the printer is correctly configured by using the lpstat command.


    #	lpstat -p printer-name
     
    
  8. (Optional) Add a description to the printer.

    # lpadmin -p printer_name -D "description"
    
  9. Add client access to the new printer.

    Now that the printer has been added, create access to the printer for the clients. See "Setting Up a Print Client".

  10. Optional tasks to complete.

    There are several optional tasks you may want to complete when setting up a printer. See "Setting Up Printing Task Map" for pointers to the remaining tasks.

Example--Adding a Local Printer Using LP Commands

This example shows how to make a local PostScript printer available for printing on a print server. The commands in this example must be executed on the print server where the printer is connected. The following information is used in the example and may change depending on your situation: