Installation
Currently there are no PPAs with newer hplip
packages.
But user can download and install binary from HP as described in their manual.
Before you proceed you should remove any hplip
related packages to avoid possible future conflicts.
If your system is a recent Debian (11 bullseye and newer) Ubuntu (20.04 LTS focal and newer), you should check for python2 legacy support installed (see below "Incompatibility with python2 legacy support on recent Debian and Ubuntu")
HP have note about this problem on support page:
Warning: If you are upgrading HPLIP and HPLIP is already preinstalled with your distribution, or you if you installed HPLIP using an RPM, DEB, or other package, please uninstall the previous version using the method specific for your distribution. If you do not do this, you may have package conflict issues or functionality problems.
I have experimentally determined the list of packages (tested on 16.04 LTS, 18.04 LTS, 20.04 LTS and 21.04) and below are commands:
sudo apt-get purge hplip hplip-data hplip-doc hplip-gui hpijs-ppds \
libsane-hpaio printer-driver-hpcups printer-driver-hpijs
sudo rm -rf /usr/share/hplip/
sudo apt-get autoremove
Then you should perform the following steps:
Step 1: Download the Automatic Installer (.run file) from official link for the Ubuntu or as for today using wget
wget -c https://download.sourceforge.net/project/hplip/hplip/3.23.3/hplip-3.23.3.run
Step 2: Run the Automatic Installer
sh hplip-3.23.3.run
Then follow instructions on screen (it should ask password of your sudo
-capable user to run apt
, and remove hplip-gui
files if they were installed). The installation process is already well-documented on HPLIP site.
After installation it will show printer installation wizard and you can add printer to the system.
Uninstallation
Here we start with binary HPLIP installation (so we do not have HPLIP-related deb-packages installed).
Let's consider that we have completed installation using file hplip-3.23.3.run
(or other version). We need to call special uninstallation script as follows:
sudo hp-uninstall
sudo rm -vrf /usr/share/hplip/
sudo rm -vrf /root/.hplip
sudo rm -v /usr/share/hal/fdi/preprobe/10osvendor/20-hplip-devices.fdi
Afterwards we install official Ubuntu packages instead (optionally):
sudo apt-get -o Dpkg::Options::="--force-confask" install --reinstall hplip hplip-data hplip-doc hplip-gui libsane-hpaio
Note: I have reported bug 1782137 to HPLIP's LaunchPad account asking developers to include uninstallation feature of deb-packages HPLIP components from Ubuntu.
Incompatibility with python2 legacy support on recent Debian and Ubuntu
Python2 is deprecated since Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) so many old python packages don't exist any more. Plus packages must explicitly refer to either python3
or python2
not python
.
For compatibility with legacy python2 code using /usr/bin/python
, two packages python-is-python2
and python-dev-is-python2
may already be installed on your system. They just install some links so python
and python-config
point to the python2 version of these commands.
You need that for instance to run the color calibration suite DisplayCal (displaycal 3.8 still relies on python2 code).
The easiest way to check is to run python --version
and see if it's python version 2 or version 3.
If you run the hplip install package, it will fail because it tries to find which version of python is to be used (probably by something based on python --version
or equivalent). If you have the python2 compatibility packages installed, the scrip is fooled and tries to install python2 dependency packages that are no longer available.
If you really need to install hplip from HP site, and you really need python2 based tools, you can always change temporarily the link on python version :
sudo apt-get install python-is-python3 python-dev-is-python3
Then run the installer.
When everything is installed edit the /usr/share/hplip/*.py
python files to replace first line (#!/usr/bin/env python
) by #!/usr/bin/python3
as it is in debian and ubuntu hplip packages.
hp-toolbox
. Binary installation is needed only if your device requires the newest HPLIP version. – N0rbert Mar 13 '19 at 20:52sudo pip2 install
s that the .run script has done? It has loaded lots of python2 dependencies on system level like opencv-python, skit-image,... Why the script invoked the sudo pip install and polluted the system? – Zeta.Investigator Mar 26 '20 at 17:21hplip-3.21.8.run
insists on installingpython-pyqt5
,python-dbus
,python-dbus.mainloop.pyqt5
,python-notify
,python-reportlab
,python-gobject
which don't exist. These packages have apython3-____
counterpart except forpython-gobject
. THose counterparts are installed but the scrip fails on pyqt5 dbus. This script is not 21.04 Hirsute Hippo compatible ! – ChrisAga Oct 31 '21 at 15:18hplip-3.21.8.run
seems to be bothpython2
andpython3
compatible. Python2 is deprecated in ubuntu 21.04 but two compatibility packages are installedpython-is-python2
andpython-dev-is-python2
respectively to link/usr/bin/python
to/usr/bin/python2
and/usr/bin/python-config
to python2 default. If possible uninstall those two packages. If not you can foolhplip-3.21.8.run
by changing the version of python/usr/bin/python
is pointing to, but beware that hplip tools won't work if you come back to python2. hplip should use python3. – ChrisAga Oct 31 '21 at 17:49error: /home/user/.local/lib/python3.8/site-packages/PyQt5/QtCore.abi3.so: failed to map segment from shared object
and thanerror: Unable to load Qt4/Qt5 support. Is it installed?
even after isntall pythonispython3 - can't get it to work again. Interactive setup of the printer works bit trying to scan for example produces anerror: /home/user/.local/lib/python3.8/site-packages/PyQt5/QtWidgets.abi3.so: failed to map segment from shared object
– Mr.Gosh Nov 10 '21 at 14:17