Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just formatted my root partition and installed 12.3 (I kept my home partition as usual).

I have a problem with my network printer hp laserjet 4015n. It used to work seemingslessly before. Now cups gives me a: Unable to write print data: broken pipe.

I have tried restarting cups, even installing the x86 version, but I can't seem to fix the problem.

I have tried different protocols to connect the printer, currently: socks://ip:9100

Any ideas on how to make this work?

share|improve this question

"Broken Pipe" with JetDirect printers usually indicates a problem establishing a network connection to the printer. It may come down to enabling debug logging in cups and seeing if that has anything, but here are some ideas:

  1. use netcat to see if you can form a TCP-level connection with the printer, this will let you know if there's a network problem (if this succeeds it could still be a network problem, but this is an easy "first test"):

    # nc -vz ip.address.of.printer

  2. Pick the generic Postscript driver for HP, and try to print a test page.

  3. See if it's a weird SELinux thing (SELinux does have certain port controls where certain programs can't listen on certain port numbers), just do a "setenforce 0" as root and try a test page again.

  4. Try to set up a new printer instance to see if it works.

  5. Check your firewall. To test set the default policy on INPUT to ACCEPT and then "iptables -F" then try a test page again.

  6. Start a binary tcpdump, submit a test page from the printer and load it up in wireshark. I have seen some cases where remote routers just won't like how cups starts the tcp connection and will send an RST as the remote node to kill off the connection. Even if that's not what's going on, it would still give you more insight into the dialog that's going on between the two systems.

If all the above fail, I would enable the debug logging and just try to wade through the results to see if it gave a specific error message explaining what's going on or if something about WHERE it's hanging up lets you know more about what's going on.

share|improve this answer
up vote 0 down vote accepted

After a lot of trial and error. The solution was to add the printer with:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.