System Administration Guide

How to Delete a Printer and Remote Printer Access

  1. Log in as superuser or lp on a print client that has access to the printer you want to delete.

  2. Delete information about the printer from the print client.


    print-client# lpadmin -x printer-name
    
    -x

    Deletes the specified printer. 

    printer-name

    Name of the printer you want to delete. 

    Information for the specified printer is deleted from the print client's /etc/lp/printers directory.

  3. If the print client does not use another printer on the same print server, delete information about the print server from the print client.


    print-client# lpsystem -r print-server
    
    -r

    Removes the specified print server. 

    print-server

    Name of the print server you want to delete. 

    The print server is deleted from the print client's /etc/lp/Systems file.

  4. Repeat Step 2through Step 3 on each print client that has access to the printer.

  5. Log in as superuser or lp on the print server.

  6. Stop accepting print requests on the printer.


    print-server# reject printer-name
    
    reject printer-name
    

    Rejects print requests for the specified printer. 

    This step prevents any new requests from entering the printer's queue while you are in the process of removing the printer. See "How to Accept or Reject Print Requests for a Printer" for a detailed description.

  7. Stop the printer.


    print-server# disable printer-name
    

    This step stops print requests from printing. See "How to Enable or Disable a Printer" for a detailed description on how to stop printing.

  8. Move any print requests that are still in the queue to another printer.

    See "How to Move Print Requests to Another Printer" for a detailed description on how to move print requests to another printer.

  9. Delete the printer from the print server.


    print-server# lpadmin -x printer-name
    

    Configuration information for the printer is deleted from the print server's /etc/lp/printers directory.

  10. Delete information about the print clients that were using the printer you just deleted, unless they are still using another printer on the print server.


    print-server# lpsystem -r print-client1 [,print-client2...]
    
    -r

    Removes the specified print client. 

    print-client

    Name of the print client you want to delete from the print server. You can specify multiple print clients in this command. Use a space or a comma to separate print client names. If you use spaces, enclose the list of print clients in quotes. 

    The specified print clients are deleted from the print server's /etc/lp/Systems file.

  11. Verify the printer information has been deleted.

    1. Check the printer information has been deleted on the print client.


      print-client$ lpstat -p printer-name -l
      

      You should receive an error indicating that the printer does not exist in the output of the above command.

    2. Check the printer information has been deleted on the print server.


      print-server$ lpstat -p printer-name -l
      

      You should receive an error indicating that the printer does not exist in the output of the above command.

Example--Deleting a Printer and Remote Printer Access

In the following example, the commands delete the printer luna from the print client terra and from the print server jupiter, and also delete the print client terra from the print server.


terra# lpadmin -x luna
Removed "luna".
terra# lpstat -p luna -l 
jupiter# lpadmin -x luna
jupiter# lpsystem -r terra
Removed "terra".
jupiter# lpstat -p luna -l