HPLIP SysTray 图标坏了,每次登录时都会崩溃 - 为什么?

HPLIP SysTray 图标坏了,每次登录时都会崩溃 - 为什么?

我正在使用 Ubuntu MATE 16.04.5 LTS 及其所有当前更新和来自官方 Ubuntu 存储库的 HPLIP:

$ dpkg -l | grep hplip
ii  hplip       3.16.3+repack0-1   amd64  HP Linux Printing and Imaging System (HPLIP)
ii  hplip-data  3.16.3+repack0-1   all    HP Linux Printing and Imaging - data files
ii  hplip-gui   3.16.3+repack0-1   all    HP Linux Printing and Imaging - GUI utilities (Qt-based)

$ apt-cache policy hplip-gui 
hplip-gui:
  Installed: 3.16.3+repack0-1
  Candidate: 3.16.3+repack0-1
  Version table:
 *** 3.16.3+repack0-1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

如果我尝试查找其 XDG 文件,我会得到:

$ dpkg -L hplip-gui | grep "xdg.*desktop"
/etc/xdg/autostart/hplip-systray.desktop

它以以下命令开始:

$ cat /etc/xdg/autostart/hplip-systray.desktop | grep Exec
Exec=hp-systray -x

如果我手动启动它,我会得到:

$ hp-systray -x

HP Linux Imaging and Printing System (ver. 3.16.3)
System Tray Status Service ver. 2.0

Copyright (c) 2001-15 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.

Segmentation fault (core dumped)

系统完整性良好——我没有收到任何错误输出debsums --all --changed

问题是 - 为什么 HPLIP Systray 崩溃了,我应该怎么做才能让它再次工作?

答案1

首先我们需要确定文件类型hp-systray

$ which hp-systray 
/usr/bin/hp-systray
$ file $(which hp-systray)
/usr/bin/hp-systray: symbolic link to ../share/hplip/systray.py
$ file $(readlink -f $(which hp-systray))
/usr/share/hplip/systray.py: Python script, ASCII text executable

-所以它是Python脚本。

然后通过读取崩溃转储,/var/crash/_usr_share_hplip_systray.py.1000.crash我们可以确定以下内容。崩溃转储包含对由安装的 Python 模块的引用pip3

...
ProcMaps:
...
 ... /usr/local/lib/python3.5/dist-packages/sip.so
 ... /usr/local/lib/python3.5/dist-packages/sip.so
 ... /usr/local/lib/python3.5/dist-packages/sip.so
 ... /usr/local/lib/python3.5/dist-packages/sip.so

因此我们需要删除有问题的sip模块

sudo pip3 uninstall sip

它解决了 HPLIP 问题,因为它将使用python3-sip包中的 sip。


但删除也会sip破坏已安装的 ReText pip3
要修复它,我们需要:

  • 调整 ReText 依赖项以使其正常工作:

    sudo -H pip3 install sip==4.18 PyQt5-sip==4.19.11 PyQt5==5.7 retext
    

    但是这种方法会导致一些不太新的硬件上的文本编辑和光标移动速度很慢。

  • 删除 deb/APT 版本,hplip如我的所述其他答案然后使用以下命令安装 ReText:

    sudo -H pip3 install PyQt5==5.9.2 retext 
    

    注意:需要 PyQt 5.9.2 才能正常运行 Chromium(WebKit)渲染器并与 Spyder3 共存。

相关内容