Introduction to Cups

The Common Unix Printing System (CUPS) is a print spooler and associated utilities. It is based on the "Internet Printing Protocol" and provides printing services to most PostScript and raster printers.

This package is known to build and work properly using an LFS 12.1 platform.

Package Information

Cups Dependencies





Avahi-0.8, libpaper-2.1.3, MIT Kerberos V5-1.21.2, PHP-8.3.3, and Python-2.7.18

Required (Postinstall)


Optional (Postinstall)

Gutenprint-5.3.4 and hplip (HP printers)

Kernel Configuration



There used to be a conflict between the Cups libusb backend and the usblp kernel driver. This is no longer the case and cups will work with both of these enabled.

If you want to use the kernel usblp driver (for example, if you wish to use escputil from Gutenprint-5.3.4) enable the following options in your kernel configuration and recompile the kernel:

Device Drivers --->
  [*] USB support --->                                             [USB_SUPPORT]
    <*/M> USB Printer support                                      [USB_PRINTER]

If you have a parallel printer, enable the following options in your kernel configuration and recompile the kernel:

Device Drivers --->
  <*/M> Parallel port support --->                                     [PARPORT]
    <*/M> PC-style hardware                                         [PARPORT_PC]
  Character devices --->
    <*/M> Parallel printer support                                     [PRINTER]

Installation of Cups

You will need to add an lp user, as Cups will create some files owned by this user. (The lp user is the default used by Cups, but may be changed to a different user by passing a parameter to the configure script.) Use the following command as the root user:

useradd -c "Print Service User" -d /var/spool/cups -g lp -s /bin/false -u 9 lp

You will also need a dedicated group that will contain users allowed to do Cups administrative tasks. Add the group by running the following command as the root user:

groupadd -g 19 lpadmin

If you want to add a user to the Cups administrative group, run the following command as the root user:

usermod -a -G lpadmin <username>

If you didn't install xdg-utils-1.2.1, use the following sed to change the default browser that will be used to access the Cups web interface:

sed -i 's#@CUPS_HTMLVIEW@#firefox#' desktop/

Replace firefox with the web browser of your choice.

Build Cups by running the following commands:

./configure --libdir=/usr/lib            \
            --with-rundir=/run/cups      \
            --with-system-groups=lpadmin \
            --with-docdir=/usr/share/cups/doc-2.4.7 &&

To test the results, issue: LC_ALL=C make -k check. An already active graphical session with bus address is necessary to run the tests. Make sure that there is not other instance of Cups running, otherwise at least 4 tests will fail with "address in use".

Now, as the root user:

make install &&
ln -svnf ../cups/doc-2.4.7 /usr/share/doc/cups-2.4.7

Create a basic Cups client configuration file by running the following command as the root user:

echo "ServerName /run/cups/cups.sock" > /etc/cups/client.conf


This package installs icon files into the /usr/share/icons/hicolor hierarchy and you can improve system performance and memory usage by updating /usr/share/icons/hicolor/index.theme. To perform the update you must have GTK+-3.24.41 installed and issue the following command as the root user:

gtk-update-icon-cache -qtf /usr/share/icons/hicolor

Command Explanations

--with-rundir=/run/cups: This switch prevents the package from referring to the deprecated /var/run directory.

--with-system-groups=lpadmin: This switch ensures that only lpadmin will be used as the Cups administrative group.

--disable-libusb: Use this switch if you have installed libusb-1.0.27, but wish to use the kernel usblp driver.

--enable-libpaper: Use this switch if you have installed libpaper and wish to use it with Cups.

Configuring Cups

Config Files


Configuration Information

Normally, printers are set up via a web browser. The Cups server will normally connect via the url http://localhost:631. From there printers, print jobs, and the server configuration can be set up and managed. Remote system administration can also be set up. Configuration can also be done from the command line via the lpadmin, lpoptions, and lpstat commands.

Configuration of Cups is dependent on the type of printer and can be complex. Generally, PostScript printers are easier. For detailed instructions on configuration and use of Cups, see

For non-PostScript printers to print with Cups, you need to install ghostscript-10.02.1 to convert PostScript to raster images and a driver (e.g. from Gutenprint-5.3.4) to convert the resulting raster images to a form that the printer understands. Foomatic drivers use ghostscript-10.02.1 to convert PostScript to a printable form directly, but this is considered suboptimal by Cups developers.

Linux PAM Configuration

If CUPS has been built with Linux PAM support, you need to create a PAM configuration file to get it working correctly with BLFS.

Issue the following command as the root user to create the configuration file for Linux PAM:

cat > /etc/pam.d/cups << "EOF"
# Begin /etc/pam.d/cups

auth    include system-auth
account include system-account
session include system-session

# End /etc/pam.d/cups

Systemd Unit

To start the cupsd daemon when something tries to access it, enable the previously installed systemd units by running the following command as the root user:

systemctl enable cups


Installed Programs: cancel, cupsaccept, cups-config, cupsctl, cupsd, cupsdisable, cupsenable, cupsfilter, cupsreject, cupstestppd, ippeveprinter, ippfind, ipptool, lp, lpadmin, lpc, lpinfo, lpmove, lpoptions, lpq, lpr, lprm, lpstat, ppdc, ppdhtml, ppdi, ppdmerge, and ppdpo
Installed Libraries: and
Installed Directories: /etc/cups, /usr/{include,lib,share}/cups, /usr/share/doc/cups-2.4.7, /run/cups, and /var/{cache,log,spool}/cups

Short Descriptions


cancels existing print jobs from the print queues


accept jobs sent to a destination


is a Cups program configuration utility


updates or queries the cupsd.conf file for a server


is the scheduler for the Common Unix Printing System


stop printers and classes


start printers and classes


is a front-end to the Cups filter subsystem which allows you to convert a file to a specific format


reject jobs sent to a destination


tests the conformance of PPD files


is an IPP Everywhere printer for CUPS


finds Internet Printing Protocol printers


sends IPP requests to the specified URI and tests and/or displays the results


submits files for printing or alters a pending job


configures printer and class queues provided by Cups


provides limited control over printer and class queues provided by Cups


lists the available devices or drivers known to the Cups server


moves the specified job to a new destination


displays or sets printer options and defaults


shows the current print queue status on the named printer


submits files for printing


cancels print jobs that have been queued for printing


displays status information about the current classes, jobs, and printers


compiles PPDC source files into one or more PPD files


reads a driver information file and produces a HTML summary page that lists all of the drivers in a file and the supported options


imports one or more PPD files into a PPD compiler source file


merges two or more PPD files into a single, multi-language PPD file


extracts UI strings from PPDC source files and updates either a GNU gettext or Mac OS X strings format message catalog source file for translation

contains the Cups API functions