# Can't get printer to work- Getting sick of this

## <3

Ok this has been a problem I've had with gentoo for years. I have never got any printer to work in gentoo. For years I have had to reboot into WinXP in order to print and I am about sick of doing that. I just got a new printer a few months ago for Christmas and now it is finally time to get this baby working in Linux but I need some help getting it to work.

Firstly the printer I have is an Epson CX7400 printer attached via USB to my local computer. I followed the instructions in the Gentoo Printing Guide to get the printer up and working. At first everything seems fine, I am able to see the CUPS web interface properly by pointing firefox at http://localhost:631. In the web interface I was able to add my printer successfully using the CUPS+Gutenprint 5.1.4 (en) driver. I am able to confirm that the usblp module is loaded into memory using lsmod and lsusb show my printer is present on my system.

```
#lsmod

...

usblp                  11968  0

...
```

```
#lsusb

Bus 001 Device 005: ID 04b8:0838 Seiko Epson Corp.

...
```

Through the CUPS web interface I was even able to print a Printer Test Page successfully, so all seems well until I actually try to print something from OO.o, firefox or any KDE application. For some reason I don't even seen my printer or CUPS as an available printer/server when selecting a printer.

Also I tried to add the printer using the KDE Control Center. As soon as I go to Peripherals->Printers Module I get an error message

 *Quote:*   

> Unable to retrieve the printer list. Error message received from Manager:
> 
> Connection to CUPS server failed. Check that the CUPS server is correctly installed and running. Error: http://localhost: host not found (1).

 

I'm not sure what that message is about because CUPS is running fine, I even tried to restart CUPS but I still get the same message. Under Print Manager->Configure Manager...->CUPS Server I have the Host set to "http://localhost" and Port as "631".

When I try to add a printer through Add->Add Printer/Class I get the error message

 *Quote:*   

> An error occured while retrieving the list of available backends:
> 
> Connection to CUPS server failed. Check that the CUPS server is correctly installed and running.

 

Is there anything in the /etc/cups/cups.conf file that I may need to edit? I don't know what half of the stuff in that file does and I haven't seen anything that looks as though I should change it from the default. Anyways here is a copy of it.

```
#

# "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $"

#

#   Sample configuration file for the Common UNIX Printing System (CUPS)

#   scheduler.  See "man cupsd.conf" for a complete description of this

#   file.

#

# Log general information in error_log - change "info" to "debug" for

# troubleshooting...

LogLevel info

# Administrator user group...

SystemGroup lpadmin

# Only listen for connections from the local machine.

Listen localhost:631

Listen /var/run/cups/cups.sock

# Show shared printers on the local network.

Browsing On

BrowseOrder allow,deny

BrowseAllow @LOCAL

# Default authentication type, when authentication is required...

DefaultAuthType Basic

# Restrict access to the server...

<Location />

  Order allow,deny

  Allow localhost

</Location>

# Restrict access to the admin pages...

<Location /admin>

  Encryption Required

  Order allow,deny

  Allow localhost

</Location>

# Restrict access to configuration files...

<Location /admin/conf>

  AuthType Basic

  Require user @SYSTEM

  Order allow,deny

  Allow localhost

</Location>

# Set the default printer/job policies...

<Policy default>

  # Job-related operations must be done by the owner or an adminstrator...

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  # All administration operations require an adminstrator to authenticate...

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

#

# End of "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $".

#
```

So that is everything that I can think of. If there is anyone who knows how to fix this please help, as I am sick of rebooting to windows just to print a page.

Thanks in advance

----------

## gm7uac

Hi, I know it might be a silly question but do you have cups in your make.conf USE options ?

Eddie.

----------

## <3

yes

----------

## gerard27

Well getting priters to work in Linux hasn't been easy.

I own an Epson Stylus Photo RX560 and had problems too.

Did you install the foomatic packages?

I don't know if cups installs them as a dependency.

In my kernelconfig I coded usblp into the kernel,but I don't think

that's the problem.

Check /var/log/cups for error messages.They might tell you something.

Gerard.

----------

## <3

No I don't have foomatic installed as the printer guide has no mention of it as a requirement to print and I don't know exactly what it is or how it works. Is their a guide for using foomatic?

----------

## Voltago

That error message of yours (no contact to cups server) reminds me of a problem I had when my cups version and my kde version were somehow mismatched. Why don't you try this (assuming you are using a resonably new kde version like 3.5.8 and cups-1.2.x):

1) mv /etc/cups /etc/_cups

2) USE=ppds emerge -1 cups

3) restart cups

4) kdesu -u root kcontrol

5) Go to Peripherals->Printers, ensure KDE is using CUPS rather than LPD or something

6) Add a printer using 'Add Printer'

7) By right-clicking the newly-added printer, make it system default and print a test page

Personally I try to avoid the web interface at all costs, but I guess that's personal preference.

EDIT: Did you check you define 'localhost' in /etc/hosts? Just a thought.Last edited by Voltago on Sun Mar 09, 2008 5:14 pm; edited 7 times in total

----------

## gerard27

At least we've found a difference between our installs.

This is what I have installed:

```

cups-1.2.12-r5

foomatic-db-20060720

foomatic-db-engine-3.0.20060720

foomatic-db-ppds-20060720

foomatic-filters-3.0.20060720

foomatic-filters-ppds-20070501

```

Hope this will put you on the right track.

Gerard.

----------

## <3

Thanks Guys for your help. This is what I have so far.

@Gerard van Vuuren: I re-emerged gimp-print with the foomaticdb use flag, which caused foomaticdb to be installed as a dependency of CUPS. I'm not sure what happened to foomatic in portage all I could find was foomaticdb. I am also running the exact versions of the same software now.

My /var/log/cups/error_log is pretty big so I won't post the entire thing but I did notice something weird.

```
I [09/Mar/2008:13:21:57 -0700] Listening to 0.0.0.0:631 (IPv4)

I [09/Mar/2008:13:21:57 -0700] Listening to :::631 (IPv6)

I [09/Mar/2008:13:21:57 -0700] Listening to /var/run/cups/cups.sock (Domain)

I [09/Mar/2008:13:21:57 -0700] Loaded configuration file "/etc/cups/cupsd.conf"

I [09/Mar/2008:13:21:57 -0700] Using default TempDir of /var/spool/cups/tmp...

I [09/Mar/2008:13:21:57 -0700] Cleaning out old temporary files in "/var/spool/cups/tmp"...

I [09/Mar/2008:13:21:57 -0700] Configured for up to 100 clients.

I [09/Mar/2008:13:21:57 -0700] Allowing up to 100 client connections per host.

I [09/Mar/2008:13:21:57 -0700] Using policy "default" as the default!

I [09/Mar/2008:13:21:57 -0700] Full reload is required.

I [09/Mar/2008:13:21:57 -0700] Loaded MIME database from '/etc/cups': 34 types, 38 filters...

I [09/Mar/2008:13:21:58 -0700] Loading job cache file "/var/cache/cups/job.cache"...

I [09/Mar/2008:13:21:58 -0700] Full reload complete.

I [09/Mar/2008:13:21:58 -0700] Listening to 0.0.0.0:631 on fd 2...

E [09/Mar/2008:13:21:58 -0700] Unable to open listen socket for address :::631 - Address family not supported by protocol.

I [09/Mar/2008:13:21:58 -0700] Listening to /var/run/cups/cups.sock on fd 3...
```

I am not sure why it is listening to 0.0.0.0:631 instead of 127.0.0.1:631. I don't know if that is an issue or not.

@Voltago: I tried re-emerging cups with the ppds use flag but I am still getting the same error as before when I try to add a printer. here is a snippet from my  /etc/hosts file

```
...

127.0.0.1       ramb00000000000 localhost

...
```

----------

## gentoo_dude

To make sure your cups daemon listens only to loopback, check your /etc/cups/cupsd.conf for

```

Listen localhost:631

```

What does the following command output:

```

netstat -natpu

```

----------

## <3

Ok I just cp /etc/cups/cupsd.conf.default /etc/cups/cupssd.conf so all should be fine there.

```
sudo netstat -natpu

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 127.0.0.1:7634          0.0.0.0:*               LISTEN      5161/hddtemp

tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      6510/cupsd

tcp        0      0 127.0.0.1:7634          127.0.0.1:56062         TIME_WAIT   -

tcp        0      0 127.0.0.1:7634          127.0.0.1:56063         TIME_WAIT   -

tcp        0      0 127.0.0.1:7634          127.0.0.1:56064         TIME_WAIT   -

tcp        0      0 127.0.0.1:7634          127.0.0.1:56065         TIME_WAIT   -

udp        0      0 0.0.0.0:631             0.0.0.0:*                           6510/cupsd
```

----------

## gentoo_dude

So it looks like the cups server bound correctly to your loopback (127.0.0.1)

Do you still see the error in the log, about not being able to listen to the address?  

Try again to print a test page from the cups server config page (I am one of those who prefer to use the CUPS web interface to set my printers).

----------

## <3

Thanks guys for your help. Looks like I am making some progress. Not exactly sure what happened but when I went to print a test page again like you said I noticed that my printer was not listed in the web interface. I am guessing that after Voltago had me  cp /etc/cups /etc/_cups then re-emerge cups all my cups files got replaced with the default ones. So I did a quick printer addition through the web interface then restarted cupsd. I am happy to say that now I am able to select my printer in openoffice and was even able to print out a test page.

For some reason though KDE is still acting stubborn. Kcontrol is still giving me the same error messages as before when I start the printer module and when I try to add a printer inside of the module. So it looks like for now I can't print through any KDE programs. I tried restarting KDE but that didn't seem to help.

----------

## Voltago

What arch are you on, and what kde version are you using?

----------

## <3

amd64 (stable) KDE 3.5.8 (also have kde 4.0.0 installed)

----------

## gentoo_dude

You do not have to add the printer under kde printing panel to print to it. 

If you open kcontrol -> Printers and just try to use CUPS you get the message you cannot connect to http://localhost:?

See if your kdelibs package was compiled with cups support.

emerge -pvt kdelibs (if the cups use flag is green then the previous version was not compiled with this flag).

P.S. if you start kate or kedit and try to print what error do you get?

P.S.S. what does your iptables -L say (especially on localhost) what about: ping localhost

----------

## <3

Yes kdelibs was compiled with the cups use flag.

When I try to print in Kate I get the error message

```
An error occured while retieving the printer list:

Connection to CUPS server failed. Check that the CUPS server is correctly installed and running. Error: http://localhost: host not found (1).
```

I don't have iptables installed.Last edited by <3 on Mon Mar 10, 2008 12:47 am; edited 1 time in total

----------

## Voltago

```
http:/localhost
```

This URL looks strange, it's missing a colon. Can anyone think of a reason for that?

----------

## <3

that was a type-o, I had to type that error message by hand since you can't copy paste it. I fixed it now.

----------

## gentoo_dude

If you run kprinter, then choose "System options", what is under CUPS server?

My settings are:   the host: /var/run/cups/cups.sock and port: 631

If the current settings don't work you might want to try there to add 127.0.0.1 instead of localhost or socket and port 631.

Check this post:

https://forums.gentoo.org/viewtopic-t-506714.htmlLast edited by gentoo_dude on Mon Mar 10, 2008 4:47 am; edited 1 time in total

----------

## <3

adding 127.0.0.1 did the trick. Maybe something is wrong with the way I defined my localhost? If so that is funny since the CUPS web interface (http://localhost:631) works fine.

----------

