hp-setup 找不到通过 USB 连接的打印机

Mat*_*aun 6 printing cups hp-printer

我在 Arch Linux 4.19.2 系统上使用 HP LaserJet P1102 时遇到问题。

\n\n

lsusb显示打印机已连接:

\n\n
Bus 002 Device 005: ID 03f0:002a HP, Inc LaserJet P1102\n
Run Code Online (Sandbox Code Playgroud)\n\n

在 中journalctl,通过 USB 插入打印机时我看到以下消息:

\n\n
kernel: usb 2-1.1: new high-speed USB device number 7 using ehci-pci\nkernel: usb 2-1.1: New USB device found, idVendor=03f0, idProduct=002a, bcdDevice= 1.00\nkernel: usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3\nkernel: usb 2-1.1: Product: HP LaserJet Professional P1102\nkernel: usb 2-1.1: Manufacturer: Hewlett-Packard\nkernel: usb 2-1.1: SerialNumber: 000000000Q80X0EGSI1c\nkernel: usb-storage 2-1.1:1.0: USB Mass Storage device detected\nkernel: scsi host6: usb-storage 2-1.1:1.0\nmtp-probe[14854]: checking bus 2, device 7: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"\nmtp-probe[14854]: bus: 2, device: 7 was not an MTP device\nmtp-probe[14867]: checking bus 2, device 7: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"\nmtp-probe[14867]: bus: 2, device: 7 was not an MTP device\n
Run Code Online (Sandbox Code Playgroud)\n\n

但是,当运行sudo hp-setup -i并选择 0 来检查 USB 连接的打印机时,我得到:

\n\n
Using connection type: usb\n\nerror: No device selected/specified or that supports this functionality.\n
Run Code Online (Sandbox Code Playgroud)\n\n

输出systemctl status org.cups.cupsd.service

\n\n
\xe2\x97\x8f org.cups.cupsd.service - CUPS Scheduler\n  Loaded: loaded (/usr/lib/systemd/system/org.cups.cupsd.service; enabled; vendor preset: disabled)\n  Active: active (running) since Fri 2018-11-23 13:03:23 CET; 25min ago\n    Docs: man:cupsd(8)\nMain PID: 6271 (cupsd)\n  Status: "Scheduler is running..."\n    Tasks: 1 (limit: 4915)\n  Memory: 7.5M\n  CGroup: /system.slice/org.cups.cupsd.service\n          \xe2\x94\x94\xe2\x94\x806271 /usr/bin/cupsd -l\n
Run Code Online (Sandbox Code Playgroud)\n\n

sudo hp-check崩溃:

\n\n
HP Linux Imaging and Printing System (ver. 3.18.6)\nDependency/Version Check Utility ver. 15.1\n\nCopyright (c) 2001-15 HP Development Company, LP\nThis software comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to distribute it\nunder certain conditions. See COPYING file for more details.\n\nNote: hp-check can be run in three modes:\n1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine if the proper   \ndependencies are installed to successfully compile HPLIP.                                                                                              \n2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built HPLIP supplied     \ntarball has the proper dependencies installed to successfully run.                                                                                     \n3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and run-time            \ndependencies).                                                                                                                                         \n\nCheck types:                                                                                                                                           \na. EXTERNALDEP - External Dependencies                                                                                                                 \nb. GENERALDEP - General Dependencies (required both at compile and run time)                                                                           \nc. COMPILEDEP - Compile time Dependencies                                                                                                              \nd. [All are run-time checks]                                                                                                                           \nPYEXT SCANCONF QUEUES PERMISSION                                                                                                                       \n\nStatus Types:\n    OK\n    MISSING       - Missing Dependency or Permission or Plug-in\n    INCOMPAT      - Incompatible dependency-version or Plugin-version\n\n-Traceback (most recent call last):\n  File "/usr/share/hplip/base/utils.py", line 266, in walkFiles\n    names = os.listdir(root)\nFileNotFoundError: [Errno 2] No such file or directory: \'/etc/PolicyKit\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/share/hplip/base/utils.py", line 268, in walkFiles\n    raise StopIteration\nStopIteration\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File "/usr/bin/hp-check", line 861, in <module>\n    dep.core.init()\n  File "/usr/share/hplip/installer/core_install.py", line 500, in init\n    self.check_dependencies(callback)\n  File "/usr/share/hplip/installer/core_install.py", line 593, in check_dependencies\n    self.have_dependencies[d] = self.dependencies[d][3]()\n  File "/usr/share/hplip/installer/core_install.py", line 1164, in check_policykit\n    if check_file(\'PolicyKit.conf\', "/etc/PolicyKit") and check_file(\'org.gnome.PolicyKit.AuthorizationManager.service\', "/usr/share/dbus-1/services"):\n  File "/usr/share/hplip/installer/dcheck.py", line 108, in check_file\n    for w in utils.walkFiles(dir, recurse=True, abs_paths=True, return_folders=False, pattern=f):\nRuntimeError: generator raised StopIteration\n
Run Code Online (Sandbox Code Playgroud)\n\n

所有软件包都更新到最新版本,这意味着sudo pacman -Syu“没有什么可做的”。

\n\n

我已经通过 pacman 安装了 Python 3.7.1。

\n\n

这是惠普软件中的错误吗?与较新的 Python 版本引入的不兼容性?

\n

Mat*_*aun 1

我通过卸载然后重新安装 hplip 解决了这个问题:

sudo pacman -R hplip && sudo pacman -S hplip
Run Code Online (Sandbox Code Playgroud)

之后,我可以再次安装 HP 的驱动程序插件

sudo hp-setup -i
Run Code Online (Sandbox Code Playgroud)

尽管下载 GPG 密钥失败

错误:无法从密钥服务器接收 [原文如此] 密钥

system-config-printer现在可以使用 HP LaserJet P1102 打印测试页。

sudo hp-check也不再崩溃:

HP Linux Imaging and Printing System (ver. 3.19.1)
Dependency/Version Check Utility ver. 15.1
...
Run Code Online (Sandbox Code Playgroud)

部分版本供参考:

  • Linux内核:5.0.4
  • hplip包1:3.19.1-1
  • 杯子包装:2.2.10-2

附录

这个问题再次出现,导致我放弃 HP 打印机并转而使用 Brother。在这个答案的底部有一些与此相关的链接。