On the client side, open up <code>/etc/cups/client.conf</code> and edit the ServerName option to match the IP address or the name of your server. For instance, I named my server beast and have an entry in my hosts file to point to it. So in my <code>client.conf</code> file, I just edited this line:

+

On the client side, open up <code>/etc/cups/cups.conf</code> and add the ServerName to match the IP address or the name of your server. Add this line:

Introduction

What is CUPS?

Straight from the CUPS website: "The Common UNIX Printing System ("CUPS") is a cross-platform printing solution for all UNIX environments. It is based on the "Internet Printing Protocol" and provides complete printing services to most Postscript and raster printers. CUPS is provided under the GNU GPL..." Although there are other printing packages such as LPRNG, CUPS is quite popular and relatively easy to use. It is the default printing system on Arch Linux as well as many other Linux distributions.

Troubleshooting CUPS & components

The best way to get printing working is to set 'LogLevel' in '/etc/cups/cupsd.conf' to:

LogLevel debug

And then viewing the output from '/var/log/cups/error_log' like this:

# tail -n 100 -f /var/log/cups/error_log

The characters at the left of the output stands for:

D = Debug
E = Error
I = Information
etc...

These files may also prove useful.

/var/log/cups/page_log 'spits out a new entry each time a print is successful.'
/var/log/cups/access_log 'lists all cupsd http1.1 server activity'

Of course it's important to know how CUPS work if you want to solve your problems, this is somewhat correct:

An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when you select 'print' (99% of apps do).

CUPS then looks at your printers PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL,PCL). Usually it needs ghostscript.

GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.

Then it is sent to the backend. For example, if you have your printer connected to a USB port, it uses the USB backend.

Print a document and watch 'error_log' to get a more detailed and correct image of the printing process.

Installing CUPS

Packages

You will need CUPS and Ghostscript for sure:

# pacman -S cups ghostscript gsfonts

cups - The actual CUPS software

dbus-core - The dbus library is needed for cups

ghostscript - An interpreter for the Postscript language

gsfonts - Ghostscript standard Type1 fonts

Here are some of the following driver packages; choosing the right driver depends on the printer you own. If unsure, install gutenprint.

gutenprint - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with Ghostscript, CUPS, Foomatic, and the Gimp.

foomatic-db, foomatic-db-engine, foomatic-db-nonfree and foomatic-filters - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix

Installing foomatic-filters should solve your problems if the cups error_log is reporting "stopped with status 22!"

hplip and net-snmp - HP Linux inkjet driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models. net-snmp should be listed as a dependency but is not as of this writing, so you should manually install it along with hplip.

ufr2 - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in AUR.

cups-pdf - A nice package that allows one to setup a virtual PDF Printer that generates a PDF out of anything sent to it.

If your system is connected to a networked printer using the samba protocol or if the system is to be a print server for Windows clients:

# pacman -S samba

Download Printer PPD

Depending on your printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the foomatic-filters, gimp-print and hplip packages already include quite a few PPD files which will automatically be detected by CUPS.

Here's an explanation of what a PPD file is from the Linux Printing website: "For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc."

Now, you will need to copy the file to the cups folder so it can detect the file. If you are in the folder where you downloaded the PPD file, you can use the following command:

# cp your_printer.ppd /usr/share/cups/model/

If you cannot find your printer on the website, you may want to try similar models or using generic printer drivers. Just do some googling or ask your manufacturer (good luck with that).

Configuring Cups

Options

Now that you have cups installed, you have a variety of options on how to setup CUPS. You can always use the tried and true command line. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help you manage your printers. However, in order to make this process easy for the largest amount of users, we will use the web interface provided by CUPS.

Please note that if you are planning on connecting to a network printer, rather than one that is directly connected to your computer, you may wish to jump to the Printer Sharing section first. Linux to Linux printer sharing is quite easy and involves very little configuration. Windows to Linux and vice-versa requires a little bit more effort, but is relatively easy as well.

Kernel Modules

Before we can use the CUPS web interface, we must install the appropriate kernel modules. The following are steps that I got from the Gentoo Printing Guide.

USB printers

If you want to use a USB printer with a 2.6.x kernel, use the following command:

# modprobe usblp

If you are using a USB printer and a 2.4.x kernel, use the following command:

# modprobe printer

Note, this assumes that you are using the stock kernels from Arch Linux. If you custom-rolled your own, you may need to run this first:

# modprobe usbcore

Once you have the modules installed, you should plug in your printer and check if the kernel detected it by running the following:

Auto-loading

You may also want to have the system automatically load the kernel module every time the computer starts up. To do this use your favorite text editor to open up /etc/rc.conf and add the appropriate module to the MODULES=() line. Here's a portion of the text from my rc.conf file:

From here, all you have to do is follow the various wizards to add your printer. To setup my Samsung ML-1250 printer, I started out by clicking on Manage Printers, and then Add Printer. I was then prompted for a username and password. I just logged in as root. I entered in ml1250 for my printer name, My Room for location and then Peter's Samsung ML-1250 Laster Printer for description. Next you will select the device. Since my printer is a USB device, I just selected USB Printer #1. The name of my printer also showed up next to the label USB Printer #1, so look for that. Next, I simply chose the appropriate drivers and the installation was complete.

Once the installation is complete, you can test your configuration by pressing the Print Test Page button.

CUPS Administration

A username and password will be required when you administrate your printer in the web interface, such as: adding or removing printers, stopping print task, etc. The default username is the username in the sys group, or the root (you can change this by editing /etc/cups/cupsd.conf in the line of SystemGroup).

If the root account has been locked, you cannot log in the CUPS administration interface by the default username and passwd. Then, you may need to change the default SystemGroup in cupsd.conf, and read this post.

Remote Access to Web Interface

By default the CUPS web interface can only be accessed by the localhost; i.e. the computer that it is installed on. To remotely access the interface make the following changes to the /etc/cups/cupsd.conf file. Replace the line

Listen localhost:631

with

port 631

so that CUPS will listen to incoming requests. There are three levels of access that can be granted:

Printer Sharing

Linux to Linux

Once you have CUPS setup on your Linux print server, sharing the printer with another Linux box is relatively easy. There are several ways to configure such a scenario -- here we will describe the manual setup. On the server computer (the one managing and connecting to the printer) simply open up /etc/cups/cupsd.conf and allow access to the server by modifying the location lines. For instance:

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 10.0.0.*
</Location>

You will also need to make sure the server is listening on the IP address your client will be addressing. Add the following line after "Listen localhost:631":

Listen 10.0.0.1:631

using your server's IP address instead of 10.0.0.1.

Add the IP address of the client computer by doing Allow From client_ip_address. After you make your modifications, you will want to restart CUPS by doing:

# /etc/rc.d/cups restart

On the client side, open up /etc/cups/cups.conf and add the ServerName to match the IP address or the name of your server. Add this line:

Linux to Windows

If you are connected to a Windows print server (or any other Samba capable print server), you can skip the section about kernel modules and such. All you have to do is start the CUPS daemon and complete the web interface as specified in section 3.3 and 3.4. Before this, you need to activate the Samba CUPS backend. You can do this by entering the following command:

# ln -s `which smbspool` /usr/lib/cups/backend/smb

Note that the symbol before is ` (underneath the ~ on a standard US keyboard) and not '. After this, you will have to restart CUPS using the command specified in the previous section. Next, simply log in on the CUPS web interface and choose to add a new printer. As a device choose "Windows Printer via SAMBA".

For the device location, enter:

smb://username:password@hostname/printer_name

Or without a password:

smb://username@hostname/printer_name

Make sure that the user actually has access to the printer on the Windows computer. Select the appropriate drivers and that's about it. If the computer is located on a domain, make sure the username includes the domain:

smb://username:password@domain/hostname/printer_name

Note: If your network contains many printers, use "lpoptions -d your_desired_default_printer_name" to set your preferred printer

Note: I, thepizzaking, was having 'NT_STATUS_ACCESS_DENIED' errors and to fix them I needed to use a slightly different syntax:

smb://workgroup/username:password@hostname/printer_name

Windows to Linux

Sometimes you might want to allow a Windows computer to connect to your Linux server. There are a few ways to do this, and the one I am most familiar with is using Samba. In order to do this, you will have to edit your /etc/samba/smb.conf file to allow access to your printers. Your smb.conf can look something like this:

Please note that in my configuration I made it so that users must have a valid account to access the printer. To have a public printer, set guest ok to yes, and remove the valid users line. To add accounts, you must set up a regular Linux account and then set up a Samba password on the server. For instance:

# useradd neocephas
# smbpasswd -a neocephas

After setting up any user accounts that you need, you will also need to set up the samba spool directory:

# mkdir /var/spool/samba
# chmod 777 /var/spool/samba

The next items that need changing are /etc/cups/mime.convs and /etc/cups/mime.types:

mime.convs:

# The following line is found at near the end of the file. Uncomment it.
application/octet-stream application/vnd.cups-raw 0 -

mime.types:

# Again near the end of the file.
application/octet-stream

The changes to mime.convs and mime.types are needed to make CUPS print Microsoft Office document files. Many people seem to need that.

After this, restart your Samba daemon:

# /etc/rc.d/samba restart

Obviously there are a lot of tweaks and customizations that can be done with setting up a Samba print server, so I advise you to look at the Samba and CUPS documentation for more help. The smb.conf.example file also has some good samples to that you might want to look at.

Windows 2000 and Windows XP to Linux

For the most modern flavors of Windows, an alternative way of connecting to your Linux printer server is to use the CUPS protocol directly. The Windows client will need to be using Windows 2000 or Windows XP. Make sure you allow the clients to access the print server by editing the location settings as specified in section 4.1.

On the Windows computer, go to the printer control panel and choose to Add a New Printer. Next, choose to give a URL. For the URL, type in the location of your printer:

where host_ip_address is the Linux server's IP address and printer_name is the name of the printer you are connecting to. After this, install the printer drivers for the Windows computer. If you setup the CUPS server to use its own printer drivers, then you can just select a generic postscript printer for the Windows client. You can then test your print setup by printing a test page.

Others to Linux, Linux to others

Appendix

Alternative CUPS Interfaces

If you are a GNOME user, you can manage and configure your printer by using the gnome-cups-manager. This package is available through pacman if you have the "community" repository uncommented in /etc/pacman.conf.

# pacman -S gnome-cups-manager

Alternatively, you may also install system-config-printer-gnome from the "community" repository:

# pacman -S system-config-printer-gnome

For system-config-printer to work as it should you may run as root or with sudo/gksudo, or alternatively set up a "normal" user to administer cups (if so follow steps 1-3)

1. Create group, and add a user

# groupadd lpadmin
# usermod -aG lpadmin <username>

2. Add "lpadmin" (without the quotes) to this line in /etc/cups/cupsd.conf

SystemGroup sys root <insert here>

3. Restart cups, log out and in again (or restart your computer)

# /etc/rc.d/cups restart

KDE users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.

There is also gtklp. It is in the "extra" repository.

# pacman -S gtklp

PDF Virtual Printer

A nice is CUPS-PDF. This package allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.

You can find generated PDF documents in a directory of your user name located in /var/spool/cups-pdf directory.

This package can be installed by the following command:

# pacman -S cups-pdf

After installing the package, you can set it up as you would for any other printer in the web interface. For the Device, select CUPS-PDF (Virtual PDF Printer); Make/Manufacturer, choose Generic; Model/Driver, select Generic postscript color printer. Alternatively, provide the PPD file from this link: [1].

Print a test page, and if printer name is color103, use at a shell prompt

lpq -Pcolor103
color103 is ready
no entries

The End

Printing does not work/aborts with the HP Deskjet 700 Series Printers.

The solution is to install pnm2ppa printer filter for the HP Deskjet 700 series. Without this the print jobs will be aborted by the system. A PKGBUILD for pnm2ppa can be found in AUR.

Getting HP LaserJet 1010 to work

I had to compile ghostscript myself because ESP gs in rep was 7.07 and had not fixed some bugs like ESP 8.15.1 had. I never downloaded 'foomatic' in rep. I think that is an old package.

$ pacman -Qs cups a2ps psutils foo ghost
local/cups 1.1.23-3
The CUPS Printing System
local/a2ps 4.13b-3
a2ps is an Any to PostScript filter
local/psutils p17-3
A set of postscript utilities.
local/foomatic-db 3.0.2-1
Foomatic is a system for using free software printer drivers with common
spoolers on Unix
local/foomatic-db-engine 3.0.2-1
Foomatic is a system for using free software printer drivers with common
spoolers on Unix
local/foomatic-db-ppd 3.0.2-1
Foomatic is a system for using free software printer drivers with common
spoolers on Unix
local/foomatic-filters 3.0.2-1
Foomatic is a system for using free software printer drivers with common
spoolers on Unix
local/espgs 8.15.1-1
ESP Ghostscript

I also had to set LogLevel in /etc/cups/cupsd.conf to debug2 before i saw that I missed some "Nimbus" fonts. Then I had to rename and put them where the log told me to. Some fancy google searching had to be applied, e.g., http://www.google.com/search?q=n019003l+filetype%3Apfb since the fonts turned out to be proprietary (I'm sure Windows comes with these by default). Nevertheless, after downloading them (about 7 fonts) and putting them in the correct directory, printing started working.

I'm sure it could have worked with ESP gs 7.07 too (in rep) if I were smart enough to turn on DebugLevel2 sooner :/ UPDATE: yeah it did... maybe this info is useful for someone else though... sorry for the inconvenience.

Getting HP LaserJet 1020 to work

Manual installation

After a lot of tries with hplib and gutenprint, I finally found the solution to get my printer HP LaserJet 1020 printing.

First of all, you only need to install cups and ghostscript. Then follow the link on http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_1020 to the http://foo2zjs.rkkda.com/ printer driver page and follow the install instructions. Log in as root. After you've downloaded the package and extracted the archive, change into the foo2zjs directory. Now you can follow the original installation instructions with a minor modification to change the userid for printing:

$ make
$ ./getweb 1020

Open the Makefile

$ nano Makefile

and search for the line

# LPuid=-olp

and modify it to

# LPuid=-oroot

then continue with the script

$ make install
$ make install-hotplug
$ make cups

Installation from AUR

You can also use the package foo2zjs from AUR and modify the PKGBUILD. Change the line:

./getweb all

to

./getweb 1020

(or if you're setting another printer, change this line to what you need).

If you get errors with incorrect md5sums, you should also change the md5sum of foo2zjs.tar.gz in PKGBUILD to match the downloaded driver.

As a last step, add and configure the printer in the CUPS manager. The printer should be recognized automatically. It works fine for root and all users. When booting the operating system, the printer is initialized and indicates it's working.

Printer connected to an Airport Express Station

The first thing to do is to scan the airport express station. It
seems that there are different addresses depending on the model.

It should work. I had a few problems. They were resolved by removing foomatic and installing foomatic-db, foomatic-db-engine, foomatic-db-ppd instead.

Performing Utility Functions on Epson Printers

Escputil

Here we explain how to perform some of the utility functions such as nozzle cleaning and nozzle checks on Epson printers. We will use the escputil utility, which is part of the gutenprint package.

There is a man page ("man escputil") that provides pretty good information, but it does not include necessary information on how to identify your printer. There are two parameters that can be used. One is --printer; what it expects is the name you used to identify your printer when you configured it. The other is --raw-device. What this option expects is is something beginning with "/dev". If your printer is a serial printer, and the only serial printer, it is "/dev/lp0". If it is a USB printer, it is "/dev/usb/lp0". If you have more than one printer, they will have names ending in "lp1", "lp2", etc.

To clean the printer heads:

escputil -u --clean-head

To print the nozzle-check pattern, allowing you to verify that the previous head cleaning worked. (Or to determine that you need to clean the heads)

escputil -u --nozzle-check

If you want to perform an operation that requires two-way communication with a printer, you must use the "--raw-device" specification and your user must be root or be a member of the group "lp".

The following is an example of getting the printer's internal identification:

sudo escputil --raw-device=/dev/usb/lp0 --identify

To print out the ink levels of the printer:

sudo escputil --raw-device=/dev/usb/lp0 --ink-level

Mtink

This is a printer status monitor which enables to get the remaining ink quantity, to print test patterns, to reset printer and to clean nozzle. It use an intuitive graphical user interface. Package can be downloaded from AUR.

Another Source for Printer Drivers

On http://www.turboprint.de/english.html is a really good printer driver for many printers not yet supported by Linux (especially Canon i*). The only problem is that high-quality-prints are either marked with a turboprint-logo or you have to pay for it -- it's not open source.

In addition, in /etc/cups, there will be a file named cupsd.conf.pacnew. Rename it cupsd.conf.

All jobs are "stopped"

After updating CUPS, if all jobs sent to the printer become "stopped", delete the printer and add it again.
Using the CUPS web interface (http://localhost:631), go to Printers > Delete Printer.

Note: If you don't remember your printer's settings, go to Printers > Modify Printer. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), etc.

The PPD version (XXXXXX) is not compatible with Gutenprint X

Run (as root)

/usr/sbin/cups-genppdupdate

And restart CUPS (as pointed out in gutenprint's post-install message)

Other

A HPLIP printer sends "/usr/lib/cups/backend/hp failed" error

Make sure dbus is installed and running, e.g. check DAEMONS in /etc/rc.conf or run 'ls /var/run/daemons'.

CUPS returns ""foomatic-rip" not available/stopped with status 3" with a HP printer

If you receive any of the following error messages in /var/log/cups/error_log while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':

Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director

Personally I experienced this with a HP LaserJet 1100A (hplip says it only supports a couple of laser models, which could make you skip the option of trying it) over an LPR print server. I don't know if it applies to using it through /dev/lp0 (parallell port) as well, although it would make sense.

Printing fails with unauthorised error

If you added yourself to the lp group, and allowed your user to print (cups.conf), then problem lies in /etc/cups/printers.conf. There should be a line that says

AuthInfoRequired negotiate

Just delete it or comment it out, restart cups and printing will magically work again.