Este conteúdo não está disponível no idioma selecionado.

Chapter 9. Adding a printer to CUPS by using the lpadmin utility


Before users can print through CUPS, you must add printers. You can use both network printers and printers that are directly attached to the CUPS host, for example over USB.

You can add printers by using the CUPS driverless feature or by using a PostScript Printer Description (PPD) file.

Note

CUPS prefers driverless printing, and using drivers is deprecated.

Red Hat Enterprise Linux (RHEL) does not provide the name service switch multicast DNS plugin (nss-mdns), which resolves requests by querying an mDNS responder. Consequently, automatic discovery and installation for local driverless printers by using mDNS is not available in RHEL. To work around this limitation, install single printers manually or use cups-browsed to automatically install a high amount of print queues that are available on a remote print server.

Prerequisites

Procedure

  • Add the printer to CUPS:

    • To add a printer with driverless support, enter:

      # lpadmin -p Demo-printer -E -v ipp://192.0.2.200/ipp/print -m everywhere
      Copy to Clipboard Toggle word wrap

      If the -m everywhere option does not work for your printer, try -m driverless:<uri>, for example: -m driverless:ipp://192.0.2.200/ipp/print.

    • To add a queue from a remote print server with driverless support, enter:

      # lpadmin -p Demo-printer -E -v ipp://192.0.2.201/printers/example-queue -m everywhere
      Copy to Clipboard Toggle word wrap

      If the -m everywhere option does not work for your printer, try -m driverless:<uri>, for example: -m driverless:ipp://192.0.2.200/printers/example-queue.

    • To add a printer with a driver in file, enter:

      # lpadmin -p Demo-printer -E -v socket://192.0.2.200/ -P /root/example.ppd
      Copy to Clipboard Toggle word wrap
    • To add a queue from a remote print server with a driver in a file, enter:

      # lpadmin -p Demo-printer -E -v ipp://192.0.2.201/printers/example-queue -P /root/example.ppd
      Copy to Clipboard Toggle word wrap
    • To add a printer with a driver in the local driver database:

      1. List the drivers in the database:

        # lpinfo -m
        ...
        drv:///sample.drv/generpcl.ppd Generic PCL Laser Printer
        ...
        Copy to Clipboard Toggle word wrap
      2. Add the printer with the URI to the driver in the database:

        # lpadmin -p Demo-printer -E -v socket://192.0.2.200/ -m drv:///sample.drv/generpcl.ppd
        Copy to Clipboard Toggle word wrap

    These commands uses the following options:

    • -p <printer_name>: Sets the name of the printer in CUPS.
    • -E: Enables the printer and CUPS accepts jobs for it. Note that you must specify this option after -p. See the option’s description in the man page on your system for further details.
    • -v <uri>: Sets the URI to the printer or remote print server queue.
    • -m <driver_uri>: Sets the PPD file based on the provided driver URI obtained from the local driver database.
    • -P <PPD_file>: Sets the path to the PPD file.

Verification

  1. Display the available printers:

    # lpstat -p
    printer Demo-printer is idle. enabled since Fri 23 Jun 2023 09:36:40 AM CEST
    Copy to Clipboard Toggle word wrap
  2. Print a test page:

    # lp -d Demo-printer /usr/share/cups/data/default-testpage.pdf
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat