I am Till Kamppeter, leader of the OpenPrinting project, home of CUPS, cups-filters and many other projects to make printing just work.
Now all needed changes on snapd got completed to get a fully working CUPS Snap into the Snap Store! See also the OpenPrinting News for the state of the art of its development.
The CUPS Snap is the complete printing stack for LInux and any other Snap-supporting operating system in a Snap. This integrates printing in operating systems which use Snaps or are even all-Snap, not using conventional (DEB, RPM, …) packages any more. It contains everything needed for printing on most modern printers in a single Snap: CUPS, cups-filters, cups-browed, Ghostscript, QPDF
The printing environment is protected by the security of Snaps, especially any inquiries from other confined Snaps go through a “cups” interface for standard user tasks like printing. listing jobs, removing one’s own jobs, … and “cups-control” for administrative tasks like creating and modifying print queues, removing anyone’s jobs, … With only “cups” being auto-connected without explicit permission when applications are put into the Snap Store one gets an additional level for getting applications which print from the Snap Store.
Classic CUPS printer drivers cannot be used any more as their components cannot be installed into the sandboxed CUPS system of the Snap. The CUPS Snap only accepts IPP printers, either driverless IPP printers, modern printers which do at least one of AirPrint, IPP Everywhere, Mopria, or Wi-Fi Direct Print (the printers on which you can print from a phone without needing a dedicated app), remote CUPS printers, or software emulations of IPP printers, the so-called Printer Applications, which are replacing the CUPS drivers (they send the jobs they receive off to a physical printer, converting the data to what the printer needs).
So in an all-Snap world a user application Snap (for example LibreOffice) sends print jobs to the CUPS Snap, CUPS spools and converts them to the needed format and then sends them off to the printers, or to the Printer Application Snap which serves as the driver for the printer.
In this post I want to ask you to test the new CUPS Snap
Before you install it, stop and disable the already installed CUPS, on modern Debian or Ubuntu distributions via the following commands:
sudo systemctl disable cups-browsed sudo systemctl stop cups-browsed sudo systemctl disable cups sudo systemctl disable cups.socket sudo systemctl stop cups
The “stop” commands stop the daemon immediately, the “disable” commands exclude it from being started during boot. Any configuration of them stays conserved and you can “enable” and “start” them again later (when you are done with testing the CUPS Snap).
Now install the Snap, either search for “CUPS” in the Snap Store/the Software application and then install the CUPS Snap, or enter the following in a terminal window:
sudo snap install --edge cups
The CUPS Snap (at least when there was no classic CUPS running when it was installed/started) uses the same socket and the same port as the standard (upstream or distro package) CUPS, so any locally running application and also the command line tools of your distro’s CUPS package use the snapped CUPS daemon now.
To the CUPS Snap’s CUPS daemon there is also a cups-browsed (included in the Snap) attached, so probably some print queues get already created automatically.
lpstat -t tells you which queues are available. Administrative commands. like
lpadmin or changing settings with
cupsctl, can be run without
sudo and without getting asked for a password by users in the “lpadmin” group or, if there is no such group in the system, by users in the “adm” group. Other users must use
sudo to run the command as root.
The snap’s command line utilities (
cups.lpadmin, …) can also be used but they can only access files in the calling user’s home directory if they are not hidden (name begins with a dot ‘
.’). So you can usually print with a command like
cups.lp -d <printer> <file>
For hidden files you have to pipe the file into the command, like with
cat <file> | cups.lp -d <printer>
or copy or rename the file into a standard file.
The web interface can be accessed under
To make administrative tasks working, you have to enter user name and password of a user in the “lpadmin” or “adm” group, or “root” and the root password if your system is configured appropriately.
Driverless IPP printers and remote CUPS printers should get available automatically, other printers will need a driver, which for the CUPS Snap must be a Printer Application. The first fully working Printer Application for common printers is the PostScript Printer Application, also available in the Snap Store, to be installed via the Snap Store/Software application or by the following command line:
sudo snap install --edge ps-printer-app
The Printer Application will automatically be started as a server daemon and all needed interface connections are done automatically.
Enter the web interface
Use the web interface to add a printer. Supply a name, select the
discovered printer, then select make and model, or simply “Automatic”, as most of the ~4000 supported printer models get correctly assigned automatically. Also set the loaded
media and the option defaults. If you ar not so lucky and your printer is PostScript but not under these ~4000 models, you can take its PPD file and add it to the Printer Application using the “Add PPD files” button on the front page. This is usually the case when your PPD file is under a proprietary license and so could not be included in free software packages or distributions. Once added, your PPD is also considered by the automatic driver selection. And to see which PPD files in the long list are user-added, they are appropriately marked (and also listed when clicking “Add PPD files” again (then you also can remove the ones you do not need any more). It is also possible to update the PPD for a supported printer simply by adding your own PPD, user-added PPDs are preferred by the automatic driver selection.
Once your PostScript printer is set up in the Printer Application, the CUPS Snap will immediately get note of it and create a CUPS queue.
Now I hope that you have a CUPS queue for your printer and so you should be able to print.
Any classically installed application (distro package or from source) and also classically confined Snaps should print (and otherwise work with CUPS) normally now. This is valid both for user applications with print functionality and also for printer setup tools.
Fully confined Snaps with print functionality print out-of-the-box if they plug the “cups” interface. This is how all such Snaps should be made. Older Snaps from the times before the “cups” interface was created, plug “cups-control”, even if they only want to print. In this case the “cups-control” interface needs to get connected manually. Snaps for printer administration (printer setup tools) must plug “cups-control” and require explicit permission from the Snap Store team if the interface should connect automatically when installing the Snap.
For more advanced operation, like running the CUPS Snap in parallel with the system’s classic CUPS (2 cups daemons on one system and each has its own cups-browsed attached) or managing the PostScript Printer Application with its own command line tool, see the
README.md files of the CUPS Snap and of the PostScript Printer Application.
Please tell your experience here in the thread and ask your questions. If you find bugs, report them at the respective projects (all use GitHub): CUPS Snap, CUPS itself, the PostScript Printer Application and its underlying library PAPPL.
News about all this and the state of the art of all the projects you find here.
Happy (snappy) printing!