debian11 linux 安装惠普打印机驱动 hplip | linux 惠普打印机扫描功能的实现 |
时间:2021-12-21 11:07:07 来源: 作者:phpsrc.com |
操作系统:DVD版的 debian11 电脑:联想笔记本 网络:WIFI同一网络 打印机:HP ColorLaserJet MFP M278-M281 无线打印机
--------------------简版说明-------------------- 其实未安装惠普打印机驱动前,用系统自带的“打印设置”,添加好打印机后,就可以打印了。发行版系统为DVD版的debian11图形化安装。
但我打印机有扫描功能,未在系统看到有扫描软件或选项。于是就需安装惠普的第三方驱动 hplip ,以实现更多功能,比如扫描。
------------------------------------------------
安装惠普第三方驱动 hplip:
用 apt install hplip 安装 hplip 成功,但在配置阶段提未出错,详细安装、配置放在文章末尾。下面根据官三链接到的第三方下载 hplip 手动安装:
hplip 安装脚本下载链接: https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
安装教程(英文): https://developers.hp.com/hp-linux-imaging-and-printing/install/install/index
最终卡在:

这条路也得放弃了。
不过在寻找资料过程,发现了一个扫描的命令:hp-scan
既然软件是安装成功了,就试试这个命令吧:

在选择设备这里,设备0和1都是打印机的IP,先选0试试,结果出错:

出现错误,中止。
那再选设备1试试,结果成功开始了文档扫描:

保存扫描文件的位置就是 shell 当前进入的目录。
虽然操作比较低效,但最终让扫描功能跑起来了。

扫描颜色模式:gray(黑白)、color(彩色)、lineart(线艺术)
命令格式: hp-scan -m color //以彩色模式扫描 hp-scan -m gray //以彩色模式扫描 hp-scan -m lineart //以彩色模式扫描
三种模式样式细微区别:

默认 hp-scan 黑白模式扫描出来的单个图片好几M,体积非常大,而彩色、线艺术模式,体积却小的非常多,画质也不受影响,所以建议将 hp-scan 的默认设置为彩色模式。
hp-scan 没有可更改默认扫描颜色模式的选项,可通过 alias 来实现:
alias hp-scan='hp-scan -m color'
将此写入到:~/.bashrc 即可。
配置文件路径:/etc/hp/hplip.conf
惠普 hplip 驱动安装后,相关命令列表:

其他参考资料:
debian11 linux 添加安装惠普打印机 HP ColorLaserJet MFP M278-M281 http://phpsrc.com/os/linux/202112/159.html
linux 惠普扫描命令 hp-scan 用法详解 http://phpsrc.com/os/linux/202112/160.html
debian11 linux 安装惠普打印机驱动 hplip | linux 惠普打印机扫描功能的实现 http://phpsrc.com/os/linux/202112/161.html
debian linux 打印机相关命令详解 lp lpr lpstat http://phpsrc.com/os/linux/202112/162.html
-----------------------apt install hplip 安装过程成功(配置失败)----------------------- phpsrc.com@phpsrc:~/www.phpsrc.com$ sudo apt install hplip 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 将会同时安装下列软件: hplip-data libhpmud0 libsane-hpaio printer-driver-hpcups printer-driver-postscript-hp python3-renderpm python3-reportlab python3-reportlab-accel 建议安装: hplip-doc hplip-gui python3-notify2 python3-renderpm-dbg python3-egenix-mxtexttools python-reportlab-doc 下列【新】软件包将被安装: hplip hplip-data libhpmud0 libsane-hpaio printer-driver-hpcups printer-driver-postscript-hp python3-renderpm python3-reportlab python3-reportlab-accel 升级了 0 个软件包,新安装了 9 个软件包,要卸载 0 个软件包,有 118 个软件包未被升级。 需要下载 9,762 kB 的归档。 解压缩后会消耗 20.4 MB 的额外空间。 您希望继续执行吗? [Y/n] y 获取:1 http://ftp.cn.debian.org/debian bullseye/main amd64 hplip-data all 3.21.2+dfsg1-2 [6,759 kB] 获取:2 http://ftp.cn.debian.org/debian bullseye/main amd64 libhpmud0 amd64 3.21.2+dfsg1-2 [188 kB] 获取:3 http://ftp.cn.debian.org/debian bullseye/main amd64 libsane-hpaio amd64 3.21.2+dfsg1-2 [213 kB] 获取:4 http://ftp.cn.debian.org/debian bullseye/main amd64 printer-driver-hpcups amd64 3.21.2+dfsg1-2 [351 kB] 获取:5 http://mirrors.ustc.edu.cn/debian bullseye/main amd64 python3-reportlab-accel amd64 3.5.59-2 [39.1 kB] 获取:6 http://mirrors.ustc.edu.cn/debian bullseye/main amd64 python3-reportlab all 3.5.59-2 [575 kB] 获取:7 http://ftp.cn.debian.org/debian bullseye/main amd64 hplip amd64 3.21.2+dfsg1-2 [289 kB] 获取:8 http://ftp.cn.debian.org/debian bullseye/main amd64 printer-driver-postscript-hp amd64 3.21.2+dfsg1-2 [1,267 kB] 获取:9 http://mirrors.ustc.edu.cn/debian bullseye/main amd64 python3-renderpm amd64 3.5.59-2 [80.0 kB] 已下载 9,762 kB,耗时 3秒 (3,024 kB/s) 正在选中未选择的软件包 hplip-data。 (正在读取数据库 ... 系统当前共安装有 503859 个文件和目录。) 准备解压 .../0-hplip-data_3.21.2+dfsg1-2_all.deb ... 正在解压 hplip-data (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 libhpmud0:amd64。 准备解压 .../1-libhpmud0_3.21.2+dfsg1-2_amd64.deb ... 正在解压 libhpmud0:amd64 (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 libsane-hpaio:amd64。 准备解压 .../2-libsane-hpaio_3.21.2+dfsg1-2_amd64.deb ... 正在解压 libsane-hpaio:amd64 (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 printer-driver-hpcups。 准备解压 .../3-printer-driver-hpcups_3.21.2+dfsg1-2_amd64.deb ... 正在解压 printer-driver-hpcups (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 python3-reportlab-accel:amd64。 准备解压 .../4-python3-reportlab-accel_3.5.59-2_amd64.deb ... 正在解压 python3-reportlab-accel:amd64 (3.5.59-2) ... 正在选中未选择的软件包 python3-reportlab。 准备解压 .../5-python3-reportlab_3.5.59-2_all.deb ... 正在解压 python3-reportlab (3.5.59-2) ... 正在选中未选择的软件包 hplip。 准备解压 .../6-hplip_3.21.2+dfsg1-2_amd64.deb ... 正在解压 hplip (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 printer-driver-postscript-hp。 准备解压 .../7-printer-driver-postscript-hp_3.21.2+dfsg1-2_amd64.deb ... 正在解压 printer-driver-postscript-hp (3.21.2+dfsg1-2) ... 正在选中未选择的软件包 python3-renderpm:amd64。 准备解压 .../8-python3-renderpm_3.5.59-2_amd64.deb ... 正在解压 python3-renderpm:amd64 (3.5.59-2) ... 正在设置 python3-renderpm:amd64 (3.5.59-2) ... 正在设置 hplip-data (3.21.2+dfsg1-2) ... 正在设置 printer-driver-postscript-hp (3.21.2+dfsg1-2) ... 正在设置 python3-reportlab-accel:amd64 (3.5.59-2) ... 正在设置 python3-reportlab (3.5.59-2) ... 正在设置 libhpmud0:amd64 (3.21.2+dfsg1-2) ... 正在设置 libsane-hpaio:amd64 (3.21.2+dfsg1-2) ... 正在设置 printer-driver-hpcups (3.21.2+dfsg1-2) ... 正在设置 hplip (3.21.2+dfsg1-2) ... Creating/updating hplip user account... 正在处理用于 libc-bin (2.31-13+deb11u2) 的触发器 ... 正在处理用于 man-db (2.9.4-2) 的触发器 ... 正在处理用于 dbus (1.12.20-2) 的触发器 ... 正在处理用于 cups (2.3.3op2-3+deb11u1) 的触发器 ... Updating PPD files for cups-filters ... Updating PPD files for hpcups ... Updating PPD files for postscript-hp ...
配置失败:
phpsrc.com@phpsrc:~/www.phpsrc.com$ hp-setup
HP Linux Imaging and Printing System (ver. 3.21.2) Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-18 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details.
qt.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 462, resource id: 0, major code: 20 (GetProperty), minor code: 0 Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=slp) Traceback (most recent call last): File "/usr/share/hplip/ui5/setupdialog.py", line 1344, in NextButton_clicked self.showAddPrinterPage() File "/usr/share/hplip/ui5/setupdialog.py", line 728, in showAddPrinterPage self.readwriteFaxInformation() File "/usr/share/hplip/ui5/setupdialog.py", line 1167, in readwriteFaxInformation self.fax_number = to_unicode(d.getPhoneNum()) File "/usr/share/hplip/fax/pmlfax.py", line 146, in getPhoneNum data = utils.printable(self.getPML(pml.OID_FAX_LOCAL_PHONE_NUM)[1].encode('utf-8')) AttributeError: 'NoneType' object has no attribute 'encode' 已放弃
在配置时出错,目前未找到原因。不过软件安装成功,其实也能使用了,具体见页首。
|
|
|
|