Why are some things so hard to configure in Linux?

From Nick Jenkins
Jump to: navigation, search

I love the reliability and stability and power of Linux, but one thing that is a royal pain in the ass is the time taken to configure something new. The worst culprits are printers and X-windows. This is especially silly because printing your work, and seeing your work on the screen, are so fundamental to how most normal people use computers.

Configuring printing[edit]

Take as an example the configuring a HP LaserJet 4 JetDirect (network) printer under Debian woody. Should be simple, yes? You'd think so - a widespread and very well known bit of hardware that has been available since around 1992, with decent vendor-supplied documentation. That, plus I'm not stupid, so figured it would take me 5 or 10 minutes, maybe 15 tops, to have it working.

So where to start? Well, for someone with only a remote X-term, and without much idea on how to do this, and no obvious tools that look suited for the task, the most obvious place to start is with some google queries. These included "debian LaserJet.4 JetDirect", and "Linux LaserJet.4 JetDirect".

One of the results of these searches lead to linuxprinting.org, which confirmed that the LaserJet 4 worked perfectly under Linux, which was a good start. It also gave a choice of SEVEN different setup instructions for the different print subsystems (yes, seven, really). I selected "lprng", since I had heard of that somewhere before, and so I installed this in Debian.

Reading through the linuxprinting's instructions for lprng, the next step appeared to be to make a /etc/printcap file. So again, I searched google, hoping to find a working example, and checked out the available packages in debian.

One thing that the printcap hits suggested was needed was a filter. One in particular looked promising - "ifhp", a package which described itself as a "Printer filter for HP LaserJet printers". So I installed this, and started to read it's documentation. The documentation for this package went on for about 10 or 15 pages, and covered all sorts of exhaustive information, apart from the most obvious thing: a working example of how to set up a printcap to actually use the filter.

So I went back to google, and queried away, trying to find an example printcap for the LaserJet 4 JetDirect using ifhp. This turned up four posted examples of printcap entries. I tried each and every one of these, but none worked. So I tried combinations of all of these, but none worked. Why they didn't work, I don't know. The printcap file format is somewhat cryptic if you don't know what it all means, and in point-of-fact don't actually care what it means, and just want to be able to print.

So after a good hour and 20 minutes of time spent thus far, I gave up on "ifhp", and started looking for another way to do it. Another package looked promising - kljettool - described as "Laser Jet tools for KDE". A GUI configuration tool - that sounded ideal! So I installed this, and fired it up, and it presented a variety of options for the printer, but nothing about remote printers. I checked every tab of the tool, but alas, it implicitly seemed to assume a local printer, so it was of no use to me. On the plus side though, it only took me a short amount of time to determine that it was of no use to me, so the total amount of time spent on this was only around 10 minutes. Furthermore, although I felt frustrated with my overall experience, I did not feel frustrated with kljettool, as it had shown me what it could and could not do in a straightforward UI, so I didn't waste a lot of time on it (unlike the time spent on the printcap file).

So at this point I went back to square one, and started reading google again for general articles about configuring these printers. On about the 15th article, I saw one newgroup post that read:

====================================================================
Do you have X Windows installed?? If you do, the printconf GUI make the
configuring of a printer a lot easier. It has a menu based screen with
dialogue boxes and buttons which you can click on to help you to configure a
printer. It then creates the entry in printcap correctly.
====================================================================

That sounded like just what I wanted, so I searched for this package called "printconf", but nothing matched. So then I did "apt-cache search print", which produced a list of 311 packages. I started scrolling this list, but it was too much to process. So then I tried " apt-cache search print | grep conf".

This produced a much shorter list of 6 options. One of these was "printtool - Tk-based printer configuration tool", which looked promising, and sounded something like "printconf", so I decided to give it a go.

Printtool installed, but when I tried to run it, it indicated that there was missing the ghostscript packages, and missing the mpage packages, and it seemed to suggest that these were important if you wanted anything more than just text output (which I did). So I tried "apt-get install ghostscript", but there were no packages of this name. So I searched on ghostscript ("apt-cache search ghostscript"), which revealed that the packages had been named "gs" rather than "ghostscript", presumably to be as cryptic as possible! So "apt-get install gs mpage" it was, which worked OK.

Finally I was able to run "printtool". It had an "autodetect" button, which sounded great to me, so I tried it, but it was not able to see this printer. So then I went and manually added an entry for the LaserJet 4 as a "direct to port printer", on the right IP address, on port 9100 (which I had seen earlier in the printcap entries), at a resolution of 600x600. Then I printed a test page, and finally it worked.

Then I looked at my watch, and I saw that all of the above had taken me slightly over 2 hours to do. TWO WHOLE HOURS of my life - Gone, forever!! Madness ! Why should it take a capable person so long to do something so simple?! The answer: It shouldn't.

My primary gripe is the lack of discoverability. It's fine to say that there is the software to make it work, which there obviously is, since it works now, but the problem is how do I, as the user who has a specific task in mind, and who is a capable human being, find out how to solve my problem? It took me 2 hours to find the solution to this problem, but the majority of people simply will not try for that long - they'll say "forget it", and give up, and never come back - thus voting with their feet.

That's what really annoys me - the time and effort required to go from "how do I install my printer?", to knowing that the specific solution to my problem is to type "apt-get install gs mpage printtool lprng", followed by "printtool".

The answer is obvious in 20/20 hindsight, but it is completely and utterly non-obvious to the ordinary person who wants to set up their printer. That is a real problem. Windows solves this problem with a standard user-interface, so that for this problem the user goes to the control panel -> printers -> add printer, and then follows the prompts. I had no idea beforehand how to set a network printer in either windows or Linux - so it's a fair comparison - and in Windows it took me 10 minutes (initially I set up a network port, which was wrong, so I tried something different, which worked), but in Linux it took me 2 hours.

It's the same for many things - I've had the same experiences getting sound cards to work under both windows and Linux, getting TV-out to work under windows and Linux, getting a DHCP client to work under windows and Linux, configuring the screen resolution in Windows versus X-windows. In each and every instance, it takes longer to do it under Linux, primarily because it is not at all obvious how to solve the problem. Essentially in Linux, you need to have solved the problem before, otherwise you're going to spend a ridiculous amount of time mucking around with configuration files - It's a struggle, and the user has to deal with low-level details that no sane user actually wants to deal with. Windows presents fewer ways of solving the problem, and it uses a GUI to do the configuration, so the amount of knowledge the user requires is decreased enormously, and solution is typically far more discoverable.

If Linux is ever going to be a good desktop OS (and I sincerely hope it will be), then Linux simply has got to get easier and quicker to configure, otherwise people will walk away.

Oh, plus I want my time back that I had to spend working all this stuff out.

Configuring printing: Redux[edit]

Update: After installing this, the overnight security check revealed that port 515 had been opened. This is a security risk. Furthermore I only want local printing (rather than people printing to my machine), so there is simply no benefit to opening a port.

I tried disabling lpd ("/etc/init.d/lprng stop"), but after I did this I could not print. So, that's not an option, but neither was leaving the port open.

So back to searching google groups it was, as well as starting the clock to see how much additional time finding a solution took.

The first newsgroup suggestion was to use ipchains to block the port. This seems a rather half-assed workaround to me - it should surely be possible to turn the thing off, rather than have to use ipchains to block it, so I kept looking. Alternatively, I would be happy to have lpd listen on the loopback device, as this is not a security hole waiting to happen, if I only I could find the way to configure this.

I also read through all of the possible options in the configuration file for lpd - "/etc/lprng/lpd.conf". This file provided plenty of configuration options, but did not show anything that looked especially promising for solving this basic problem.

I read some more articles, all of which were suggesting firewalling the port, rather than fixing the basic problem that no network port was desired or even needed.

So eventually I gave up on lprng:

apt-get --purge remove lprng

[This uninstalled printtool as well]

...and tried installing lpr:

apt-get install lpr 

Then I checked the open ports again ("netstat -nlp"), only to see that port 515 has been opened again by lpd. How to turn this damn thing off? I tried stopping lpd ("/etc/init.d/lpd stop"), but printing did not work again. So I tried starting it again, but printing (from KDE) still did not work.

I tried printing from the command line "lpr file.txt", which produced this error message: "lpr: cannot create /var/spool/lpd/lp1/.seq".

At this point I decided to reinstall printtool, since it was the only thing that had actually worked in a way that made sense to me: "apt-get install printtool".

This replaced "lpr" with "lpr-ppd". Netstat still showed port 515 as open to the world ("0.0.0.0:515").

I searched again for an lpd.conf file - "find / | grep lpd.conf" - this turned up nothing, so for some reason I no longer even had a configuration file for lpd.

Printing no longer worked (it gave the "lpr: cannot create /var/spool/lpd/lp1/.seq" error message). I edited the printer in printtool and then saved the changes, and then printing started working again.

I reinstalled lprng. I searched for lpd.conf, but again the file was simply not there. I stopped and restarted some printer services, and then the lpd.conf file appeared - I guess the stopping and starting caused it to be created.

A section of the LPRng howto called "LPD Server Runnning on Localhost" mentioned the force_localhost parameter, which looked promising. I tried adding the "default force_localhost" parameter to the lpd.conf - no effect. I tried adding "force_localhost" and then "force_localhost@" to the /etc/printcap - no effect.

I tried searching google again, read the FAQ section of the lprng docs, but nothing seemed to answer my basic question. I knew from the newsgroups posts that others had had the question about why port 515 was open, and I had come to the conclusion that lpd was needed to print, and that it could not be stopped from listening to the network (or if it could, I wasn't going to find it documented in a simple fashion any time soon).

At this point, I had spent exactly 83 minutes of additional time (bringing the grand total time spent to 203 minutes), still had an open port 515, with no sensible way of turning it off, besides the ipchains hack. I had had enough. I gave up at this point - I simply refused to spend any more time beating my head against a brick wall. Port 515 is still open, albeit behind a firewall.


Update: "apsfilter" looks like another possible way of configuring a printer without too much hassle, but I just stumbled onto this by chance after writing the above, rather than finding it at the time when I had the problem.

Other people equally annoyed[edit]

Update 27-Feb-2004: Other people have had a similar rant, such as here for setting up video playing software, and here for someone else also trying to get network printing to work. What's more I know that these two other authors were both technical people, and they both had the same fundamental problems - it's too damn hard, it takes too damn long, it's too damn frustrating, and if technical people have problems then what chance is there for the remaining 99% of people who have no clue?

Where Windows is far ahead of Linux[edit]

Some examples of things that are many orders of magnitudes easier and more discoverable under Windows than they are under Linux:

  • Set up a printer under Windows.
  • Install updated video drivers under Windows.
  • Set up your desktop resolution and refresh rates under Windows.

Man pages should include examples[edit]

Update 23-August-2004: Man pages need to be friendlier to access and to have examples. I've seen these comments from others on the web, and I've collected them here because I agree with them:

  • I'd wager that computer literacy amongst people who've tried Linux would be twice what it is today if when you typed "help foobar bash" would perform a man foobar if 'foobar' wasn't a builtin command. And it'd probably be double that if you incorporated some kind of search facility too. Type in help disk space and get a hit on the df command, for instance.
  • What I'd really like to see is a more helpful man page with examples. It's frustrating when using a new command to read "usage: foobar [VNFHDMudndghfud8734yfhfnbgdh] filename | device | dir | options filename[]" and then read through 5 pages of options and switches I'll never use. If every man page had at least a few examples of how to do stuff most people want to do, it'd be easier to both do those things and learn the more complex commands.
  • Another nice thing would be a howdoi command which allows the input of natural language and spits out a small man page (with examples!) or help file, ie, "$>howdoi see how much hard drive space i have" spits out how to use df.