LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1771|回复: 6

[求助] 无法使用"双面打印" (网络打印机的安装已经解决)

[复制链接]
发表于 2009-9-25 21:07:55 | 显示全部楼层 |阅读模式
主题:网络打印机安装失败.hplip, cups表现都不太正常
(网络打印机的问题已经解决)

实验室局域网内最近添加了一台网络打印机,通过印机上的网口连入交换机,接入局域网。打印机的型号为 HP P2055n。Windows用户按照附赠的光盘“下一步”、“下一步”就能找到打印机。Linux用户就得自己折腾CUPS和hplip。但是,hp-setup配置通不过,提示找不到PPD文件(实际上所需文件是存在的);后来改用CUPS的 Web Interface 添加打印机,添加成功,打印测试页成功,但是在gnome中无法看到,gnome-cups-manager提示无法连接到CUPS服务器。

我参照的是下面两份资料:
Getoo Wiki CUPS
http://en.gentoo-wiki.com/wiki/CUPS

Gentoo Wiki Hplip
http://www.gentoo-wiki.info/HPLIP

安装了hplip。其中,hplip 添加了cups, ppds的USE Flags. CUPS因为依赖关系,在安装hplip时被带了进来。我所安装的hplip、CUPS版本以及USE Flags如下:

net-print/hplip
Installed versions: 3.9.8 (cups cupsddk dbus gtk ppds snmp -doc -fax -minimal -parport -policykit -qt3 -qt4 -scanner)

net-print/cups
Installed versions:  1.3.10-r2 (X acl avahi dbus gnutls jpeg linguas_en linguas_zh_TW pam perl png ppds python samba ssl tiff zeroconf -java -kerberos -ldap -linguas_de -linguas_es -linguas_et -linguas_fr -linguas_he -linguas_id -linguas_it -linguas_ja -linguas_pl -linguas_sv -php -slp -static -xinetd)

按照CUPS Wiki的指示,以root身份运行hplip中的工具 hp-setup 配置打印机 (之前已经启动cups服务):

一切看起来还算顺利:


  1. HP Linux Imaging and Printing System (ver. 3.9.8)
  2. Printer/Fax Setup Utility ver. 9.0

  3. Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
  4. This software comes with ABSOLUTELY NO WARRANTY.
  5. This is free software, and you are welcome to distribute it
  6. under certain conditions. See COPYING file for more details.

  7. (Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)


  8. --------------------------------
  9. | SELECT CONNECTION (I/O) TYPE |
  10. --------------------------------

  11.   Num       Connection  Description                                               
  12.             Type                                                                  
  13.   --------  ----------  ----------------------------------------------------------
  14.   0*        usb         Universal Serial Bus (USB)                                
  15.   1         net         Network/Ethernet/Wireless (direct connection or JetDirect)

  16. Enter number 0...1 for connection type (q=quit, enter=usb*) ? 1

  17. Using connection type: net

  18. Using device: hp:/net/HP_LaserJet_P2055dn?zc=NPI96EE9A


  19. Setting up device: hp:/net/HP_LaserJet_P2055dn?zc=NPI96EE9A



  20. ---------------------
  21. | PRINT QUEUE SETUP |
  22. ---------------------


  23. Please enter a name for this print queue (m=use model name:'HP_LaserJet_P2055dn'*, q=quit) ?
复制代码


然后,问题发生了:


  1. Locating PPD file... Please wait.
  2. error: No PPD found for model laserjet_p2055dn using new algorithm. Trying old algorithm...
  3. error: No PPD found for model laserjet_p2055dn using old algorithm.
  4. error: Unable to find an appropriate PPD file.

  5. Would you like to specify the path to the correct PPD file to use (y=yes, n=no*, q=quit) ?
复制代码


这就奇怪了,给2205dn用的PPD命名就在机子上:

  1. find ./ -iname '*2055dn*'
  2. ./share/ppd/HP/hp-laserjet_p2055dn-pcl3.ppd.gz
  3. ./share/ppd/HP/hp-laserjet_p2055dn-ps.ppd.gz
复制代码


后来尝试了 hplip 的其他两个版本:
3.9.4b-r1 问题一模一样
2.8.6b-r1 根本找不到网络打印机

hplip暂时作罢,改用 CUPS 的 Web Interface 来配置:  http://localhost:631/

添加比较顺利,打印测试页成功,如图所示。

但是在 Gnome 应用程序的“打印”中无法看到这个打印机。耐着性子,装了一个gnome-cups-manager,但是,点开时提示“无法连接到CUPS服务器”,如图所示。

觉得匪夷所思,老子的CUPS明明是打开了,后来借用hplip的check.py,发现,hplip也认为CUPS是没有打开的。不知大家在安装HP网络打印机时有没有遇到这样的麻烦事?



  1. # ./check.py

  2. HP Linux Imaging and Printing System (ver. 3.9.8)
  3. Dependency/Version Check Utility ver. 14.3

  4. Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
  5. This software comes with ABSOLUTELY NO WARRANTY.
  6. This is free software, and you are welcome to distribute it
  7. under certain conditions. See COPYING file for more details.

  8. Note: hp-check can be run in three modes:
  9. 1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine  
  10. if the proper dependencies are installed to successfully compile HPLIP.                                                                 
  11. 2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built     
  12. HPLIP supplied tarball has the proper dependencies installed to successfully run.                                                      
  13. 3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and      
  14. run-time dependencies).                                                                                                                 

  15. Saving output in log file: hp-check.log

  16. Initializing. Please wait...

  17. ---------------
  18. | SYSTEM INFO |
  19. ---------------

  20. Basic system information:
  21. Linux frontlab 2.6.30-gentoo-r6 #3 SMP Wed Sep 9 21:39:33 CST 2009 i686 Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz GenuineIntel GNU/Linux

  22. Distribution:
  23. gentoo 0.0

  24. Checking Python version...
  25. OK, version 2.6.2 installed

  26. Checking PyQt 4.x version...
  27. error: NOT FOUND OR FAILED TO LOAD!

  28. Checking for CUPS...
  29. error: Status: (Not available. CUPS may not be installed or not running.)

  30. Checking for dbus/python-dbus...
  31. dbus daemon is running.
  32. python-dbus version: 0.83.0


  33. ------------------------------------
  34. | COMPILE AND RUNTIME DEPENDENCIES |
  35. ------------------------------------

  36. note: To check for compile-time only dependencies, re-run hp-check with the -c parameter (ie, hp-check -c).
  37. note: To check for run-time only dependencies, re-run hp-check with the -r parameter (ie, hp-check -r).

  38. Checking for dependency: CUPS - Common Unix Printing System...
  39. error: NOT FOUND! This is a REQUIRED/RUNTIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

  40. Checking for dependency: CUPS DDK - CUPS driver development kit...
  41. OK, found.

  42. Checking for dependency: CUPS devel- Common Unix Printing System development files...
  43. OK, found.

  44. Checking for dependency: CUPS image - CUPS image development files...
  45. OK, found.

  46. Checking for dependency: DBus - Message bus system...
  47. OK, found.

  48. Checking for dependency: gcc - GNU Project C and C++ Compiler...
  49. OK, found.

  50. Checking for dependency: GhostScript - PostScript and PDF language interpreter and previewer...
  51. OK, found.

  52. Checking for dependency: libcrypto - OpenSSL cryptographic library...
  53. OK, found.

  54. Checking for dependency: libjpeg - JPEG library...
  55. OK, found.

  56. Checking for dependency: libnetsnmp-devel - SNMP networking library development files...
  57. OK, found.

  58. Checking for dependency: libpthread - POSIX threads library...
  59. OK, found.

  60. Checking for dependency: libtool - Library building support services...
  61. OK, found.

  62. Checking for dependency: libusb - USB library...
  63. OK, found.

  64. Checking for dependency: make - GNU make utility to maintain groups of programs...
  65. OK, found.

  66. Checking for dependency: PIL - Python Imaging Library (required for commandline scanning with hp-scan)...
  67. OK, found.

  68. Checking for dependency: PolicyKit - Administrative policy framework...
  69. warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

  70. Checking for dependency: PyQt 4 DBus - DBus Support for PyQt4...
  71. error: NOT FOUND! This is a REQUIRED/RUNTIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

  72. Checking for dependency: Python DBus - Python bindings for DBus...
  73. OK, found.

  74. Checking for dependency: Python devel - Python development files...
  75. OK, found.

  76. Checking for dependency: Python libnotify - Python bindings for the libnotify Desktop notifications...
  77. warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

  78. Checking for dependency: Python XML libraries...
  79. OK, found.

  80. Checking for dependency: Python 2.3 or greater - Required for fax functionality...
  81. OK, found.

  82. Checking for dependency: Python 2.2 or greater - Python programming language...
  83. OK, found.

  84. Checking for dependency: Reportlab - PDF library for Python...
  85. warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

  86. Checking for dependency: SANE - Scanning library...
  87. error: NOT FOUND! This is a REQUIRED/RUNTIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

  88. Checking for dependency: SANE - Scanning library development files...
  89. error: NOT FOUND! This is a REQUIRED/COMPILE TIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.

  90. Checking for dependency: scanimage - Shell scanning program...
  91. warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.

  92. Checking for dependency: xsane - Graphical scanner frontend for SANE...
  93. warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.


  94. ----------------------
  95. | HPLIP INSTALLATION |
  96. ----------------------


  97. Currently installed HPLIP version...
  98. HPLIP 3.9.8 currently installed in '/usr/share/hplip'.

  99. Current contents of '/etc/hp/hplip.conf' file:
  100. # hplip.conf.  Generated from hplip.conf.in by configure.

  101. [hplip]
  102. version=3.9.8

  103. [dirs]
  104. home=/usr/share/hplip
  105. run=/var/run
  106. ppd=/usr/share/ppd/HP
  107. ppdbase=/usr/share/ppd
  108. doc=/usr/share/doc/hplip-3.9.8
  109. icon=/usr/share/applications
  110. cupsbackend=/usr/libexec/cups/backend
  111. cupsfilter=/usr/libexec/cups/filter
  112. drv=/usr/share/cups/drv/hp

  113. # Following values are determined at configure time and cannot be changed.
  114. [configure]
  115. network-build=yes
  116. pp-build=no
  117. gui-build=no
  118. scanner-build=no
  119. fax-build=no
  120. dbus-build=yes
  121. cups11-build=no
  122. doc-build=no
  123. shadow-build=no
  124. hpijs-install=no
  125. foomatic-drv-install=no
  126. foomatic-ppd-install=no
  127. foomatic-rip-hplip-install=no
  128. hpcups-install=yes
  129. cups-drv-install=yes
  130. cups-ppd-install=yes
  131. internal-tag=3.9.8.36
  132. restricted-build=no
  133. ui-toolkit=no
  134. qt3=no
  135. qt4=no
  136. policy-kit=no
  137. hpijs-only-build=no
  138. lite-build=no
  139. udev-acl-rules=yes


  140. Current contents of '/var/lib/hp/hplip.state' file:
  141. # hplip.state - HPLIP runtime persistent variables.

  142. [plugin]
  143. installed=0
  144. eula=0



  145. Current contents of '~/.hplip/hplip.conf' file:


  146. --------------------------
  147. | DISCOVERED USB DEVICES |
  148. --------------------------

  149. No devices found.

  150. ---------------------------------
  151. | INSTALLED CUPS PRINTER QUEUES |
  152. ---------------------------------


  153. /usr/bin/lpstat
  154. ---------------
  155. Type: Unknown
  156. Device URI: Unable to connect to server


  157. ---------------------
  158. | PYTHON EXTENSIONS |
  159. ---------------------

  160. Checking 'cupsext' CUPS extension...
  161. OK, found.

  162. Checking 'pcardext' Photocard extension...
  163. OK, found.

  164. Checking 'hpmudext' I/O extension...
  165. OK, found.


  166. ---------------
  167. | USER GROUPS |
  168. ---------------

  169. root bin daemon sys adm disk wheel floppy dialout tape video games vmware


  170. -----------
  171. | SUMMARY |
  172. -----------

  173. error: 11 errors and/or warnings.

  174. Please refer to the installation instructions at:
  175. http://hplip.sourceforge.net/install/index.html

复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2009-9-25 21:51:54 | 显示全部楼层

网络打印机安装完成,出现的新问题是“无法双面打印”

网络打印机安装成功:

参考了《Gentoo Samba3/CUPS HOWTO》
http://www.gentoo.org/doc/en/quick-samba-howto.xml

Here are common errors that may happen:

    * The hostname given as a parameter for -h and -H (PrintServer) often does not resolve correctly and doesn't identify the print server for CUPS/Samba interaction. If an error like: Warning: No PPD file for printer "CUPS_PRINTER_NAME" - skipping! occurs, the first thing you should do is substitute PrintServer with localhost and try it again.

查看了自己的 /etc/cups/client.conf,内容如下:
ServerName /var/run/cups/cups.sock

我改成了:
ServerName localhost

重启CUPS,再次运行hp-setup,这次打印机安装成功了。gnome-cups-manager也能顺利连上CUPS,并且可以方便的配置已经打印机属性。gnome-cups-manager也可以添加新的打印机,但是用起来明显没有hp-setup方便。

现在的新问题是:无法使用“双面打印”功能,这通常是在[打印] -> [高级]中提供的,现在这个选项打不开。普通Gnome程序如此,Acroread也是如此。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-25 22:52:55 | 显示全部楼层

只能通过改变打印机属性来进行双面打印了,权限问题?

问题有了一些新的眉目,但是现在有些累了,决定放一放:

首先,可以通过“root”身份在 gnome-cups-manager 中调整Printer的属性,设为双面打印。

下面的网页对我帮助很大:

“Printing with Adobe Reader”
http://blogs.adobe.com/acroread/

在 Shell 中输入:

export ACRO_PRINT_DEBUG=1

然后在acroread中打开一个PDF,尝试Print, 点击 Property,则Shell中出现了下面的提示:

PPD not found - cupsGetPPD failed

文中也提到了几种典型的错误:
    *
          o Error : dlopen of libcups failed
          o Possible Problem : Libcups not in LD_LIBRARY_PATH
          o Solution : Make sure LD_LIBRARY_PATH points to the libcups
    *
          o Error : No destinations returned by cupsGetDests
          o Possible Problem : No printers configured on the machine.
          o Solution : Configure the printer using the CUPS web UI.
    *
          o Error : PPD not found - cupsGetPPD failed
          o Possible Problem : No ppd available for the printer or ppd accidentally moved
          o Solution : Re-launch reader, check for the ppd or reconfigure the printer
    *
          o Error : Error opening PPD - ppdOpenFile failed
          o Possible Problem : No ppd available for the printer or ppd accidentally moved
          o Solution : Re-launch reader, check for the ppd or reconfigure the printer


看看,什么时候有时间再折腾折腾。
回复 支持 反对

使用道具 举报

发表于 2009-9-27 11:18:55 | 显示全部楼层
以前遇到过类似的问题,不知道是否对你有帮助:

在打印机管理里,有一项叫 duplex unit 的,默认不会被选上,选上后就能设置双面打印了。见 http://localhost:631 之打印机管理。
回复 支持 反对

使用道具 举报

发表于 2009-9-27 11:22:04 | 显示全部楼层
多说一句:HP 的打印机驱动完全没有必要那么麻烦,只要安装了 cups,直接使用 cups 自带的 hp generic PCL 4/5 或 hp generic PCL 6 就行,我在 hp laserjet p3005d 上使用 hp generic pcl 6,正常,哈哈。
回复 支持 反对

使用道具 举报

发表于 2009-9-30 16:04:19 | 显示全部楼层
我用的是hp1020打印机,很久以前记得一个说明文件中说的是不支持双面打印的。难到说现在可以了?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-11-29 15:34:06 | 显示全部楼层

hplip现在已经能双面打印

问题已经莫名其妙地解决了。所用软件的版本:

net-print/cups-1.3.11-r1 (X acl avahi dbus gnutls jpeg linguas_en linguas_zh_TW pam perl png ppds python samba ssl tiff zeroconf -java -kerberos -ldap -linguas_de -linguas_es -linguas_et -linguas_fr -linguas_he -linguas_id -linguas_it -linguas_ja -linguas_pl -linguas_sv -php -slp -static -xinetd)

net-print/hplip-3.9.10 (gtk hpcups hpijs snmp zeroconf -doc -fax -libnotify -minimal -new-hpcups -parport -policykit -qt3 -qt4 -scanner -static-ppds -udev-acl)

安装网络打印机的过程我还是倾向于使用hplip提供的hp-setup。一切顺利,ppd也顺利找到了。
  1. # hp-setup
  2. ...
  3. Device URI: hp:/net/HP_LaserJet_P2055dn?zc=NPI96EE9A
  4. Queue name: HP_2055
  5. PPD file: lsb/usr/HP/hp-laserjet_p2055dn-ps.ppd.gz
  6. Location: Front HP
  7. ...
复制代码

然后,在acrobat,或者是gedit(gnome管理打印机)中,都可以调出双面打印的菜单。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表