1 of 2: CUPS (New-Style) Printing Setup (Recommended)

From: Federico Sevilla III (jijo@free.net.ph)
To: plug@lists.q-linux.com
Subject: Re: [plug] Configuring Debian to......
Date: Tue, 13 Aug 2002 11:19:55 +0800

On Tue, Aug 13, 2002 at 07:45:37AM +0800, Fel Bryan wrote:

> How do I configure Debian to use a printer? I've read the HOWTOs, but
> it seems too generalized.

Rick already chimed in on how to use apsfilter and company. Now, I'll chime in on CUPS.

# apt-get install cupsys cupsys-client

This will get CUPS up and running. Now, using your Web browser, go to http://localhost:631/printers, and add a printer.

You may need to customize /etc/cups/cupsd.conf, if you want multiple CUPS installations over the network to talk, by allowing browsing, or if you want it to modify /etc/printcap instead of /etc/printcap.cups. Printing from your GNU/Linux apps should be easy after that. My OpenOffice.org configuration even allows me to pick exactly which printer to use (since we have two machines each with CUPS installed, hosting a printer each).

For command line queue management, read the manual pages of lpq(1) and lprm(1).

--> Jijo

Federico Sevilla III : <http://jijo.free.net.ph/>
Network Administrator : The Leather Collection, Inc.
GnuPG Key ID : 0x93B746BE

[Rick Moen adds: The administrative access via Web browser requires you to authenticate using a Linux username/password of someone who's in the /etc/group entry for group "lpadmin". And you'll definitely need to add package cupsys-bsd, in order to be able to reach the CUPS subsystem via standard lpr commands.]

Date: Fri, 14 Mar 2003 20:37:27 -0800
From: Rick Moen (rick@linuxmafia.com)
Subject: Re: CUPS config. - Debian
To: LUV (luv@luv.asn.au)
User-Agent: Mutt/1.4i

Quoting Barry Kirsten (kirsten@pacific.net.au):

> I've been having trouble for some time getting CUPS running under Debian 3.0.
> My problem is that I can't access the GUI (http://localhost:631) using any
> browser (connection refused - or similar error), so am unable to configure
> Can someone using CUPS under Debian 3.0 kindly send me a copy of their
> /etc/cups/cupsd.conf (active, non-commented part only) so I can check it
> against mine?

I had to put off answering this query of Barry's for quite a while, because the Debian-testing ("sarge") machine I set up CUPS on was temporarily turned off and unavailable. I've just had occasion to fire it up, and the requested file is as follows:

ServerAdmin rick@linuxmafia.com
AccessLog /var/log/cups/access_log
ErrorLog /var/log/cups/error_log
LogLevel info
PageLog /var/log/cups/page_log
#Printcap /etc/printcap.cups
Printcap /etc/printcap

User lp
Group sys
Port 631
Browsing Off
SystemGroup lpadmin

<Location />
Order Deny,Allow
Deny From All
Allow From

<Location /admin>
AuthType Basic
AuthClass System
Order Deny,Allow
Deny From All
Allow From

As suggested by the commented-out line above, I believe the only editing magic I had to do (last August, so this is a bit fuzzy in my memory) was deduce from weird errors in logfiles that "Printcap /etc/printcap.cups" needed to be changed to "Printcap /etc/printcap". (You could do a symlink, instead.)

Also, CUPS's administrative access via Web browser requires you to authenticate using a Linux username/password of someone who's in the /etc/group entry for group "lpadmin" -- so be sure to add yourself to that (by running "vigr" as root). At that point, I vaguely recall that it's just a matter of opening a Web browser to "http://localhost:631/printers" and using the CUPS admin screens to add a printer definition -- which in turn populates /etc/printcap and wherever else CUPS stores its printer definitions (/etc/cups/printers.conf, it appears).

I'm betting that what's stalling Barry is not /etc/cups/cups.conf, but rather the lack of lpadmin-group membership.

I took care of the /etc/printcap matter solely because I needed CUPS's BSD lpr interface to work, for the benefit of (arguably) backward-looking applications that expect to print only to such an interface. Accordingly, I also installed package "cupsys-bsd", which is the lpr-emulation shim piece (front-end). My recollection is that cupsys-bsd expects to read lpr-style printer info from /etc/printcap, whereas the default contents of /etc/cups/cups.conf cause the CUPS admin routines to write lpr printer info to /etc/printcap.cups . All that the edit I did (or the equivalent symlink) accomplishes is to repair the disconnect between those two packages.

Complete list of Debian packages I installed to make all of the above work: cupsys cupsys-client cupsys-bsd

In retrospect, these might also have been nice: foomatic-db foomatic-bin

Even with CUPS (or PDQ, which is more sparse and elegant), printing on Unix still sucks. ;-> I tend to dread dealing with it, and therefore did my best to document the steps required on Debian, here, for reference: http://linuxmafia.com/faq/Debian/printing-setup.html

That file discusses Debian setup of both BSD lpr and CUPS.

Date: Wed, 02 Apr 2003 20:00:46 -0800
From: Rick Moen (rick@linuxmafia.com)
Subject: Re: My computer
To: luv@luv.asn.au
User-Agent: Mutt/1.4i

Quoting Nevyn the noisy (nevyn-luv@artificial-stupidity.net):

> better than that there's the cups configuration tool in kde. go to control
> centre -> system -> print manager make sure cups is selected then click add
> new printer -> usb printer -> epson -> C41SX
> click done etc

Good idea! If it's installed and working, that would be great.

It's part of the kdebase package, which also requires the following other packages: kdelibs3, libc6, libfam0, libjpeg62, libkonq3, libpng2, libqt2, libstdc++2.10-glibc2.2, xlibs, zlib1g, debianutils, xfree86-common, libpam-modules, kdewallpapers, and kdebase-libs. Not everybody has the kitchen sink installed. ;->

Personally, the one time I set up CUPS on Debian, I pretty much just used a Web browser.

As it happens, the "printtool" package packaged for Debian-testing currently seems to not do CUPS. Requires: lpr-ppd or lprng, printfilters-ppd, pconf-detect, tk8.3 or tk8.2 or tk8.0, and gs or gs-aladdin. Having a short list of dependencies is A Good Thing, in my view.

Date: Thu, 03 Apr 2003 14:56:16 +1000
From: Andrew Laird (ajlaird@optushome.com.au)
Subject: Re: My computer
To: luv@luv.asn.au
Organization: Trinity Computer Services
X-Mailer: Ximian Evolution 1.2.3

On Thu, 2003-04-03 at 09:43, Avery de Brouwer wrote:

> I have USB Mitsubishi Diamond View Scanner v4.02
> An Epson C41SX Printer
> [...]
> The printer turns on with booting put won't print
> I'm supposed to have CUPS and I can find them through Konqueror but they're
> not installed through Konsole Terminal Window

OK, according to Grant's instructions you should do the following:

1. Click on Start and choose Control Center on the main menu.

2. Once in Control Center, double click on System, and then double click on Printing Manager.

3. In the bottom right hand corner there is a button labelled 'Administrator Mode'. Click on it and then enter your system's root password when prompted. Click on OK to continue.

4. Now, in the bottom right hand corner is a dropdown list which allows you to choose which print system is to be used. It should say CUPS; if it doesn't then select CUPS.

5. OK, click on the add printer/class wizard button (the first button on the toolbar in the right hand frame).

6. Click 'Next >'.

7. Choose Local printer and click 'Next >'.

8. Choose parallel port #1 and click 'Next >'.

9. Choose 'EPSON' for the manufacturer and 'Stylus C41SX' (if it is in the list - otherwise choose 'Stylus C40SX') for the model, and click 'Next >'.

10. Choose a printer driver: there may be more than one choice, probably best to choose one that says 'gimp-print' in brackets, then click 'Next >'.

11. At this point, you should be able to test your configuration by clicking on the button labelled 'Test'. If the test is satisfactory, then click on 'Next >', otherwise click on '< Back' and choose a different printer driver. Repeat until you find one that works.

12. Name your printer, click on 'Next >' and then click on 'Next >' one last time.

Andrew Laird.

From: "Donald R. Spoon" (dspoon@satx.rr.com)
Newsgroups: linux.astcomm.net
Subject: Tips on CUPS + KDE + Debian Testing WARNING: Long Message!
Date: Wed, 20 Feb 2002 02:04:34 -0600
Organization: news.astcomm.net
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214

Hi fellers! Here is a post I recently put up on the Debian-KDE mailing list. Thought some of you might be interested..
-Don Spoon-

I recently decided to install CUPS on my main linux box with the eventual goal of making it a print-server for the rest of my home LAN. I was sucessful in getting it going on the single machine because of questions asked by others on the Debian-KDE and Debian-Users mailing lists. Getting it going on a single machine has been discussed in previous messages, so I won't dwell on that aspect of it.... except to make a few notes:

1. The cupsys-driver-gimpprint package is EXCELLENT. It supports a wide variety of printers, and of all the printer drivers I have tried, it far excels in the quality of printing on my HP 960c inkjet. Highly recommeded! BEWARE! This package comes in several languages & ALL are installed. The "en" is the second selection from the top, and is NOT diferentiated as such during the KDE printer config. You can only see the differences if you use the "localhost:631" method to configure your printer.

2. If you are going to be in a "mixed" system that involves some lpr systems, you might want to pay close attention during the install to the question about setting cupsysd "suid root". My LAN is/will be straight CUPS, so it didn't make much difference. You also want to install the cupsys-bsd package.

3. A fully-functional CUPS + KDE install in Debian Testing will require the following packages: cupsys, cupsys-client, cupsys-pstorastor, libcupsys2, and kdelibs3-cups. If you want lpr/bsd compatability with other printing systems, you should add cupsys-bsd.

4. The KDE "Control Center -> System -> Printing Manager" tool is EXCELLENT. About all you have to do to get a running system is select CUPS as your printing system at the bottom, and add your printer. This will bring up a wizard that will lead you through all the steps. This is the series of screens that will show you about 4 available gimpprint drivers that all look the same. They are not... select the second one from the top if you want English or check it with the http screens available at "localhost:631".

After I got CUPS running on a single machine, I turned my attention to getting it on my LAN as the LAN printer. I wandered around in the desolate wilderness of the documentation for about a week without any progress. I finally yelled for help on the Debian-Users mailing list, and a kind soul guided me through a MANUAL config for the network. After I got it going, I re-traced my steps, and again, the KDE Printing Manager proved to be the BEST tool to set it up. Here are the steps:

1. Pull up the Printing Manager and click on the "Configure Server" Icon.

2 Accept the default settings EXCEPT for the below steps:

3. Check the "Enable Browsing" on the "Browsing" screen.

4. Go to the "Security" screen. In the "Resources" box, you should find two entries already there.. one for "Root" and another for "Administration". Click on "add" and select your printer's name (lp?) from the pull-down resource menu. Click on the "Access" tab and put your LAN IP number in the "Allow" box (i.e. 192.168.10.*) and "ALL" in the "Deny" box The order should be "Deny, Allow". Click OK to save the changes.

5. Restart the server... there is a button for it to the left of the "Configure Server" icon.

At this point remote computers running CUPS will list your printer and you can set it to be the "default" on the remote systems. Check out everything by printing test pages.

I hope these ruminations will prevent others from the aimless wandering and editing of various conf files that I did. I appologize to those who think I have wasted their time.

-Don Spoon-

Date: Thu, 25 Jul 2002 12:16:29 +1000
From: Andrew Pilley (ashridah@cyber.com.au)
Subject: Re: Scripting printer(s) creation
To: SteveSimeonidis@spherion.com
Cc: luv@luv.asn.au

Allow me to suggest setting up CUPS on these servers. Setup one as a master, that contains the configuration of the printers, and setup the rest to do broadcasting. It's detailed in the CUPS configuration documentation.

That way, any changes to the printserver, will be reflected by the other fileservers immediately, without extra fiddling.

Samba also integrates nicely with CUPS, and CUPS 1.1.14 comes with Red Hat 7.3 (there's a Red Hat switch tool to change from lprNG to CUPS, and note that i've heard rumours of Red Hat dropping lprNG for CUPS in 8.0 (judging by beta.)). note that the Samba team recommend the use of CUPS, nowadays. Unix clients are even simpler to support; all you need is to setup a single line pointing to the printserver in /etc/cups/client.conf

The only bug in 1.1.14 is that cupssmbadd doesn't seem to work, and IIRC that's fixed in 1.1.15, but 1.1.15 has some other major functionality changes, so it's not a straight simple upgrade.

Print drivers for HP Laser/DeskJets, Epson Stylus's, and Lexmark printers are included with CUPS (possibly with one or two other major brands) and gimpprint has more. as does www.linuxprinting.org (usually, all that's needed is a ppd file from the manufacturer)

www.cups.org has more info. It also supports Windows clients natively, since Win2k/XP can use IPP (athough I hadn't heard about it until I started using CUPS), and you can specify printing using http://prinserver:631/printers/printername.

Date: Tue, 25 Jul 2006 14:12:44 -0700
To: svlug@lists.svlug.org
From: Rick Moen (rick@linuxmafia.com)
Subject: Re: [svlug] Debian cups/printer install

Quoting Skip Evans (skip@bigskypenguin.com):

> Got it.
> Found a page... wait for it... > http://linuxmafia.com/faq/Debian/printing-setup.html
> (Thanks in absentia, Rick.)

You're welcome -- and, in case it wasn't obvious, I was reading postings in date/thread order, not latest-first. ;-)

A few comments on the above-cited file (which I've now HTMLised a bit better, by the way):

Although it dates from 2002, a lot of it's a bit backwards-looking: It was written about the time many of us were just realising that lpr/lprNG really were dead, and that we'd never have to worry about them again (except as shim utilities for backwards utility, feeding print jobs into CUPS).

Also about that time, a promising local-workstation-only, non-queuing print package, pdq ("print, don't queue") referred to in passing on my page was dying for lack of maintenance, and is now history. So, certainly by 2006, printing on the various Unixes is CUPS (optionally with those lpr-emulation shims).

Setting up printing on Unix thus requires installing a CUPS client on the machine that needs to print, setting up and starting a CUPS daemon at some network-accessible location (the same place as the client, in simple setups), installing adequate selection of print filters ("drivers") for the print daemon's use in talking to your printers -- e.g., apsfilter, foomatic packages, etc -- and then using the CUPS Web administrative interface to configure the daemon's knowledge of how and where to print.

And remember, http://www.linuxprinting.org/ is your friend.

Date: Tue, 25 Jul 2006 14:24:13 -0700
From: Rick Moen (rick@linuxmafia.com)
To: svlug@lists.svlug.org
Subject: Re: [svlug] Debian cups/printer install

I wrote:

> Also about that time, a promising local-workstation-only, non-queuing
> print package, pdq ("print, don't queue") referred to in passing on
> my page was dying for lack of maintenance, and is now history.

One of the nice things about open source projects is that dead ones can be revived, given enough interest: http://pdq.sourceforge.net/ is now looking active again, having been revived in mid-June, 2006, after six years in cold storage.

It looks like Jeremy C. Reed is in charge.

2 of 2: lpr (Old-Style) Printing Setup (Deprecated: Use CUPS, Instead)

[Archivist's note: Seriously, don't use lpr/lprNG: They're terrible, and you really should use CUPS in preference. This documentation is still here primarily for historical reasons.]

From rick Mon Aug 12 18:23:19 2002
Date: Mon, 12 Aug 2002 18:23:19 -0700
To: plug@lists.q-linux.com
Subject: Re: [plug] Configuring Debian to......

Quoting Fel Bryan (silence@pacific.net.ph):

> How do I configure Debian to use a printer? I've read the HOWTOs, but
> it seems too generalized. With Red Hat and Mandrake, they have a sort
> of configuration utility for printers. Does Debian have one?

Printer setup on Unix in general is kind of miserable. I happen to have finally gotten around to setting it up on my Debian server, as follows:

Install packages gs, apsfilter, a2ps, mpage, recode, enscript, lpr. (You could almost certainly make this work with gnulpr or lprng, instead of lpr. I'm just mentioning something I made work easily.)

Now (still as root), run apsfilterconfig. This will create the necessary spool directory(ies) and configure the entry or entries in /etc/printcap. Save. Exit. Restart lpd. And you're done.

That was on a machine that doesn't have X11 (a server). It might be easier to install CUPS on your typical Debian workstation:

# apt-get install cupsys cupsys-client foomatic-db foomatic-bin

I don't have any experience with that, though, and tend to flee from Unix printing in convulsive horror. ;->

[RM adds: You'll also need to create /etc/hosts.lpd or /etc/hosts.equiv, and the former is much to be preferred from a security perspective. For the syntax, see the manpage for hosts.equiv .]