RedHat 7:lpadmin 找不到 HP ppd 文件?

RedHat 7:lpadmin 找不到 HP ppd 文件?

我正在尝试从命令行在 RedHat 7.5 系统上添加打印机,如下所示:

/sbin/lpadmin -p printername -v socket://printerfqdn:9100 -m hp-laserjet_3015-ps.ppd.gz -L "Room number goes here" -E

该命令失败并出现以下错误消息:

lpadmin: Unable to copy PPD file.

我安装了HP相关的软件包:

hpijs.x86_64                                                                                                                            
hplip.x86_64                                                                                                                            
hplip-common.x86_64                                                                                                                     
hplip-libs.x86_64  
                                                                                                               I found that this error happens because the PPD file that I had specified with `-m ` is located in `/usr/share/ppd/HP` (from the hpijs RPM), but apparently cups only looks in `/usr/share/cups/model`

当然,一个简单的解决方法是创建一个从预期位置到实际文件位置的链接,但我确信 RedHat 是故意创建这个目录结构的。

从命令行在 RedHat 7 上安装 HP Laserjet 3015 的官方方法是什么?

编辑:

命令:

lpinfo -m | grep 3015

显示以下内容:

foomatic-db-ppds/Epson/epl6200.ppd.gz EPSON EPL-6200 PS3 v3015.102 foomatic-db-ppds/Epson/epln2500.ppd.gz EPSON EPL-N2500 PS3 v3015.102 foomatic-db-ppds/Epson/epln2550.ppd.gz EPSON EPL-N2550 PS3 v3015.102 foomatic-db-ppds/Epson/epln3000.ppd.gz EPSON EPL-N3000 PS3 v3015.102 foomatic-db-ppds/Epson/epln7000.ppd.gz EPSON EPL-N7000 PS3 v3015.102 gutenprint.5.2://hp-lj_3015/expert HP LaserJet 3015 - CUPS+Gutenprint v5.2.9 gutenprint.5.2://hp-lj_3015/simple HP LaserJet 3015 - CUPS+Gutenprint v5.2.9 Simplified foomatic:HP-LaserJet_3015-gutenprint-ijs-simplified.5.2.ppd HP LaserJet 3015 Foomatic/gutenprint-ijs-simplified.5.2 foomatic:HP-LaserJet_3015-gutenprint-ijs.5.2.ppd HP LaserJet 3015 Foomatic/gutenprint-ijs.5.2 foomatic:HP-LaserJet_3015-Postscript.ppd HP LaserJet 3015 Foomatic/Postscript drv:///hp/hpijs.drv/hp-laserjet_3015-hpijs-pcl3.ppd HP LaserJet 3015 hpijs pcl3, 3.15.9 drv:///hp/hpcups.drv/hp-laserjet_3015-pcl3.ppd HP LaserJet 3015 pcl3, hpcups 3.15.9 hp-laserjet_3015-ps.ppd.gz HP LaserJet 3015 Postscript lsb/usr/HP/hp-laserjet_3015-ps.ppd.gz HP LaserJet 3015 Postscript

这是在我使用上述链接解决方法之后拍摄的。在另一台 HP 打印机上使用类似命令会显示以下内容:

[root@mycomputer ~]# lpinfo -m | grep m1522 lsb/usr/HP/hp-laserjet_m1522_mfp-ps.ppd.gz HP LaserJet M1522 MFP Series Postscript lsb/usr/HP/hp-laserjet_m1522n_mfp-ps.ppd.gz HP LaserJet M1522 MFP Series Postscript lsb/usr/HP/hp-laserjet_m1522nf_mfp-ps.ppd.gz HP LaserJet M1522 MFP Series Postscript drv:///hp/hpijs.drv/hp-laserjet_m1522nf_mfp-hpijs-pcl3.ppd HP LaserJet m1522nf MFP hpijs pcl3, 3.15.9 drv:///hp/hpcups.drv/hp-laserjet_m1522nf_mfp-pcl3.ppd HP LaserJet m1522nf MFP pcl3, hpcups 3.15.9

答案1

您必须使用 lpinfo 输出中的“完整”路径:

/sbin/lpadmin -p printername -v socket://printerfqdn:9100 -m lsb/usr/HP/hp-laserjet_3015-ps.ppd.gz -L "Room number goes here" -E

相关内容