我的系统是ubuntu22.04,打印机为惠普m30w
flutter@flutterUbuntu:~/桌面$ sudo apt-get install hplip-gui
以下内容没用,只是记录我的弯路
flutter@flutterUbuntu:~/桌面$ sudo apt-get remove libhpmud0 libsane-hpaio printer-driver-postscript-hp
hp官方下载驱动
https://nchc.dl.sourceforge.net/project/hplip/hplip/3.22.6/hplip-3.22.6.run
赋予运行权限
运行的过程中非常慢,卡在python依赖库上,我换成阿里云库
flutter@flutterUbuntu:~/桌面$ mkdir ~/.pip
flutter@flutterUbuntu:~/桌面$ gedit ~/.pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
flutter@flutterUbuntu:~/桌面$ pip3 config list
global.index-url='https://mirrors.aliyun.com/pypi/simple/'
install.trusted-host='mirrors.aliyun.com'
然后
多运行几次
------------安装好以后还是找不到打印机--------
还需要安装hp-plugin
flutter@flutterUbuntu:~/桌面$ hp-plugin
显示错误error: Python gobject/dbus may be not installed
这是解决方案,如下:https://bugs.launchpad.net/hplip/+bug/1813768 。
您必须禁用插件的 apparmor。
sudo aa-disable /usr/share/hplip/plugin.py
为此,您需要一些工具,这些工具应该已经安装在您的系统上,但如果没有,只需键入:
sudo apt-get install apparmor-utils
然后 hp-plugin 工作!(至少对我们中的一些人来说…)