Some printer manufacturers want to make money buy selling over priced printing cartridges after they got you with an under priced printer. To increase there profit, they add things as a page counter to their system, to refuse printing and to refuse refilling. In the past the cartridges where transparent so it was easy to observe their status, but now they want to restrict that to the user. So first advise don't buy such a printer and if you have one, try to hack it or dump it. For the future I hope this will become illegal due to environmental laws.

However when the printer does not print it could also have an other reason as the inkjet apertures are closed due to dry-ed ink. Wipe it of with a bit of spirituous can make wonders. Finally there are also software problems maybe caused due to updates.

Due to the long history of Unix there is some line printer functions (character printing) but also graphic printing as cups.

Line printer

lpq shows printer jobs

lprm<n> kills printer jobs


After installing cups, the cups daemon needs to be started:

/etc/init.d/cupsd start

or permanently:

rc-update add cupsd default

then cups can be opened and configured in a (root) web browser http://localhost:631

where you can print test pages.

And if your printer wants to destroy all paper that it finds, it might become out of synchronization with the queue so: /etc/init.d/cupsd stop

To do some administrative tasks as adding a printer you need to login as user root with the root password.

Install a printer

Using Cups, this is a straight forward task, go to http://localhost:631 and select a printer from the list or (set the ppds use flag) go to and download the ppd file for your printer model.

If you have a HP printer install hplip read then run hp-setup and finally /etc/init.d/cupsd restart and as regular user hp-toolbox

/usr/share/ppd/HP contains a lot of ppd files that are automatically selectable in cups. In gentoo Linux there is an autostart useflag that puts a desktop file in /etc/xdg/autostart

Cups has a Driver Development kit to create PPD files. I is part of newer cups, but was once separate (cupsddk).

For printers connected locally to the parallel port, make sure the kernel has those modules loaded (either including in the kernel or loaded via /etc/modules.autoload.d/kernel-2.6):

  1. parport

  2. parport_pc

  3. lp

The you should get: /dev/lp0 and within http://localhost:631 you should be able to select lp when adding a new printer.

The configuration is stored in /etc/cups/cupsd.conf and /var/log/cups contains the log.

If root can print, but a normal user not, check for the write access rights of /var/tmp since spool files will be written there.

Print on a printer attached on an other computer

On the server side, the computer that has attached the printer, open http://localhost:631 and in the Administration tab enable in the Server section Share published printers connected to this system. and on client and server side add

/etc/init.d/cups-browsed start

or permanently:

rc-update add cups-browsed default

On the client side type in a console lpstat -v to see the available network printers, as printers using the Internet Printing Protocol (ipp).

Open http://localhost:631 and go under printers, they are available without any additional configuration using a device URI as: ipp:// . Print a test page using the http://localhost:631 page and try to print using a regular application.

Brother p-touch 2500pc label printer

Foomatic is an open database for printers. Among other things, it can be used to create ppd files to by used by cups. To describe the printers, the foomatic database contains xml files. Type emerge foomatic-db-engine to get the database and the conversion program. /usr/share/foomatic/db/source/printer holds the supported printers.

To get a ppd file (PostScript Printer Description) for a brother p-touch 2500pc label printer type

foomatic-ppdfile list | grep 2500PC

"foomatic-ppdfile:Brother-PT-2500PC-ptouch.ppd" en "Brother" "Brother PT-2500PC Foomatic/ptouch (recommended)" "MFG:Brother;MDL:2500PC;CMD:PT-CBP;"

So to see the driver type:

foomatic-ppdfile -p Brother-PT-2500PC

And to save it

foomatic-ppdfile -p Brother-PT-2500PC > Brother-PT-2500PC-ptouch.ppd

A place to put the ppd file is there where the others are /usr/share/cups/model

For more info man foomatic-ppdfile

Now the ppd file is created, however the driver is missing. Then emerge ptouch-driver that can be found in my overlay at It also gets foomatic xml files that would be in conflict to the foomatic-db ebuild. Therefore

To get it unmerge first emerge --unmerge foomatic-db and emerge --unmerge foomatic-db-engine.

The ptouch-driver ebuild gets the cups raster driver /usr/lib/cups/filter/rastertoptch to convert the cups raster data it into a byte stream on stdout suitable for sending directly to a label printer of the Brother P-touch family.

did link make it in ebuild

ln -s /usr/lib/cups/filter/rastertoptch /usr/bin/rastertopch

PDF printers

Some programs have PDF export or a virtual PDF printer functionality that is not part of cups. To have something independently of those programs a virtual cups pdf printer can be installed: emerge cups-pdf. Open http://localhost:631 and add this printer. Type in something as cupspdf and as description virtual pdf printer. For the device choose cups-pdf and for the model choose the file /usr/share/cups/model/CUPS-PDF.ppd. Per default the pdf files can be found in /var/spool/cups-pdf. This default can be set in /etc/cups/cups-pdf.conf.

Figure 9.3. Cupspdf

Cups pdf

Printing from the command line

Cups can also be used on the command line and understands lots of file formats. This is quite handy when using scripts or to find out why is why I get is not what I see.

See man lp

lpstat -p -d shows what printers I got

lpoptions -p Deskjet_D1600 -l shows what the printer can

lpoptions -d <printer> sets the default printer

lp -d Deskjet_D1600 <filename>.jpg prints it

lp -d Deskjet_D1600 -o page-ranges=1 <filename>.pdf prints first page

lp -d Deskjet_D1600 -o page-ranges=2-3 <filename>.pdf prints page 2 to 3

lp -d Deskjet_D1600 -o fitplot <file>.pdf is the most important command since what you see will also fit to what you get.

Other options -o outputorder=reverse prints last page first so the pile gets on a simple printer ordered

Printer troubleshooting

Since printing involves many packages it is important to find first the package that causes troubles.

  1. Do you have troubles just with one printer or with all (try cups-pdf)? If yes check your printer installation.

  2. Is it possible to print from other applications as OOO-Writer, Acrobat-Reader? If yes check your desktop system.

  3. Is it possible to print as root (or other user)? If yes, check permissions.

Linurs Servernest startpage