Cups linux printing system

OpenPrinting CUPS

The current standards-based, open source printing system developed by OpenPrinting for Linux® and other Unix®-like operating systems. CUPS uses IPP Everywhere™ to support printing to local and network printers.

Introduction

CUPS supports printing to:

  • AirPrint™ and IPP Everywhere™ printers,
  • Network and local (USB) printers with Printer Applications, and
  • Network and local (USB) printers with (legacy) PPD-based printer drivers.

CUPS provides the System V («lp») and Berkeley («lpr») command-line interfaces, a configurable web interface, a C API, and common print filters, drivers, and backends for printing. The cups-filters project provides additional filters and drivers.

CUPS is licensed under the Apache License Version 2.0 with an exception to allow linking against GNU GPL2-only software.

A Brief History of CUPS

CUPS was originally developed by Michael R Sweet at Easy Software Products starting in 1997, with the first beta release on May 14, 1999. Not long after, Till Kamppeter started packaging CUPS for Mandrake Linux and created the Foomatic drivers for CUPS, leading the adoption of CUPS for printing on Linux. Apple licensed CUPS for macOS in 2002, and in February 2007 Apple purchased CUPS and hired Michael to continue its development as an open source project.

In December 2019, Michael left Apple to start Lakeside Robotics. In September 2020 he teamed up with the OpenPrinting developers to fork Apple CUPS to continue its development. Today Apple CUPS is the version of CUPS that is provided with macOS® and iOS® while OpenPrinting CUPS is the version of CUPS being further developed by OpenPrinting for all operating systems.

Setting Up Printer Queues

CUPS includes a web-based administration tool that allows you to manage printers, classes, and jobs on your server. Open http://localhost:631/admin/ in your browser to access the printer administration tools. You will be asked for the administration password (root or any other user in the «sys», «system», «root», «admin», or «lpadmin» group on your system) when performing any administrative function.

Читайте также:  Unpacking rar in linux

The «lpadmin» command is used to manage printers from the command-line. For example, the following command creates a print queue called «myprinter» for an IPP Everywhere printer at address «11.22.33.44»:

lpadmin -p myprinter -E -v "ipp://11.22.33.44/ipp/print" -m everywhere

You can run the «lpinfo» command to list all of the available drivers («lpinfo -m») or printers («lpinfo -v»).

Printing Files

CUPS provides both the System V («lp») and Berkeley («lpr») commands for printing:

Both the «lp» and «lpr» commands support printing options for the driver:

lp -o media=A4 -o resolution=600dpi filename lpr -o media=A4 -o resolution=600dpi filename

CUPS recognizes many types of images files as well as PDF, PostScript, and text files, so you can print those files directly rather than through an application.

If you have an application that generates output specifically for your printer then you need to use the «-o raw» or «-l» options:

lp -o raw filename lpr -l filename

This will prevent the filters from misinterpreting your print file.

Источник

CUPS — Print Server

The primary mechanism for Ubuntu printing and print services is the Common UNIX Printing System (CUPS). This printing system is a freely available, portable printing layer which has become the new standard for printing in most Linux distributions.

CUPS manages print jobs and queues and provides network printing using the standard Internet Printing Protocol (IPP), while offering support for a very large range of printers, from dot-matrix to laser and many in between. CUPS also supports PostScript Printer Description (PPD) and auto-detection of network printers, and features a simple web-based configuration and administration tool.

Installation

To install CUPS on your Ubuntu computer, simply use sudo with the apt command and give the packages to install as the first parameter. A complete CUPS install has many package dependencies, but they may all be specified on the same command line. Enter the following at a terminal prompt to install CUPS:

Читайте также:  Linux вычислить md5 файла

Upon authenticating with your user password, the packages should be downloaded and installed without error. Upon the conclusion of installation, the CUPS server will be started automatically.

For troubleshooting purposes, you can access CUPS server errors via the error log file at: /var/log/cups/error_log . If the error log does not show enough information to troubleshoot any problems you encounter, the verbosity of the CUPS log can be increased by changing the LogLevel directive in the configuration file (discussed below) to “debug” or even “debug2”, which logs everything, from the default of “info”. If you make this change, remember to change it back once you’ve solved your problem, to prevent the log file from becoming overly large.

Configuration

The Common UNIX Printing System server’s behavior is configured through the directives contained in the file /etc/cups/cupsd.conf . The CUPS configuration file follows the same syntax as the primary configuration file for the Apache HTTP server, so users familiar with editing Apache’s configuration file should feel at ease when editing the CUPS configuration file. Some examples of settings you may wish to change initially will be presented here.

Tip

Prior to editing the configuration file, you should make a copy of the original file and protect it from writing, so you will have the original settings as a reference, and to reuse as necessary.

Copy the /etc/cups/cupsd.conf file and protect it from writing with the following commands, issued at a terminal prompt:

sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original 
  • ServerAdmin: To configure the email address of the designated administrator of the CUPS server, simply edit the /etc/cups/cupsd.conf configuration file with your preferred text editor, and add or modify the ServerAdmin line accordingly. For example, if you are the Administrator for the CUPS server, and your e-mail address is ‘bjoy@somebigco.com’, then you would modify the ServerAdmin line to appear as such:
ServerAdmin bjoy@somebigco.com 
Listen 127.0.0.1:631 # existing loopback Listen Listen /var/run/cups/cups.sock # existing socket Listen Listen 192.168.10.250:631 # Listen on the LAN interface, Port 631 (IPP) 

In the example above, you may comment out or remove the reference to the Loopback address (127.0.0.1) if you do not wish cupsd to listen on that interface, but would rather have it only listen on the Ethernet interfaces of the Local Area Network (LAN). To enable listening for all network interfaces for which a certain hostname is bound, including the Loopback, you could create a Listen entry for the hostname socrates as such:

Listen socrates:631 # Listen on all interfaces for the hostname 'socrates' 
Port 631 # Listen on port 631 on all interfaces 

For more examples of configuration directives in the CUPS server configuration file, view the associated system manual page by entering the following command at a terminal prompt:

Note

Whenever you make changes to the /etc/cups/cupsd.conf configuration file, you’ll need to restart the CUPS server by typing the following command at a terminal prompt:

sudo systemctl restart cups.service 

Web Interface

Tip

CUPS can be configured and monitored using a web interface, which by default is available at http://localhost:631/admin . The web interface can be used to perform all printer management tasks.

In order to perform administrative tasks via the web interface, you must either have the root account enabled on your server, or authenticate as a user in the lpadmin group. For security reasons, CUPS won’t authenticate a user that doesn’t have a password.

Читайте также:  Linux посмотреть системные логи

To add a user to the lpadmin group, run at the terminal prompt:

sudo usermod -aG lpadmin username 

Further documentation is available in the Documentation/Help tab of the web interface.

Источник

Оцените статью
Adblock
detector