Latest update: august 2022 for Ubuntu 22.04. and hplip version 3.22.6.
If you are here, you probably tried to install hplip without success.
Prerequisite: make sure you are using Python3.x running
$ python --version
If you are using Python2.x you should switch to Python3. Pay attention to old software you are running with Python2…this operation may break something!
$ sudo apt install python-dev-is-python3
$ sudo apt install python-is-python3
Old hplip packages can be removed during the installation process in the “DEPENDENCY AND CONFLICT RESOLUTION” phase.
Let’s start with the installation.
Go to the developer website and take a look to the section named “Advanced Option“.
…or if you want to download the package directly you can run:
$ wget https://sourceforge.net/projects/hplip/files/hplip/3.22.6/hplip-3.22.6.tar.gz/download
Unpack it and run the installer:
$ mv download hplip-3.22.6.tar.gz
$ tar -xvf hplip-3.22.6.tar.gz
$ cd hplip-3.22.6
$ ./hplip-install
Follow the most suitable wizard and be patient…pay attention to each installation step and read carefully what the wizard is saying. In most cases you can simply confirm the default choice suggested by the wizard. Retry the command if you face some exceptions and wait if the process takes a little bit longer.
At the end of the wizard if you don’t find any problem the package has been installed. In case hp-plugin cannot be installed, you are asked to do it manually:
error: hp-plugin command failed. Please run hp-plugin manually.
$ hp-plugin
Let’s now add the printer. Run the following command and follow the instructions:
$ hp-setup
Now to scan a document you have to run
$ hp-scan
In some cases you need to restart the OS to make it work after the installation.
If you find any problem please share it here.
Cheers
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Hi Edoardo,
Thanks for the page and providing me its link. Would you please mind giving simple steps as I am kind of a novice to Ubuntu. ๐ I hardly open the Terminal. If something goes wrong, I am not able to refix it. Hope, you’d understand. How to ‘untar’ and ‘jump into the directory’ as you say in step 3?
Hi kamyogi, I updated the post with the information that you requested ๐
I would suggest you to learn more about Bash and Ubuntu, in this way you can understand exactly what you are running and how to fix any problem ๐
Hi Edo, it works! Thank you very much indeed.
Thank you for this method, I’ve seen others that seem to “unlink” and “link” to different directories, making it very difficult for a new user, or it might break after an update. HOWEVER, I found a different problem. By replacing the python version (so hplip can work), but now, that breaks Virtualbox! Since I use Virtualbox more than the printer, I have to re-install (fortunately, from backup image).
So, either I test hplip / printing from INSIDE Virtualbox (and so don’t break the Host), or I have to print from Windows (e.g. old laptop). Thanks again.
You are welcome!
I’m personally running Python 3.8.5 and VirtualBox 6.1.16 without any compatibility problem. Please feel free to share with us causes and fixes about your issue ๐
Hi Chris, I tried to replicate your problem.
I found a fix that worked for me.
You can find it at the top of this post.
Let me know.
Cheers
Absolutely Perfect – Thank you! I originally could not get HPlip to function or load. HP directions did not work. You solved the problem. Ubuntu 20.04 working with my HP ENVY 6055 printer wirelessly!
You are welcome Rodger ๐
Unfortunately I get the following errors (any hint?)
error: A required dependency ‘libjpeg (libjpeg – JPEG library)’ is still missing.
error: A required dependency ‘libpthread (libpthread – POSIX threads library)’ is still missing.
error: A required dependency ‘libusb (libusb – USB library)’ is still missing.
error: A required dependency ‘libnetsnmp-devel (libnetsnmp-devel – SNMP networking library development files)’ is still missing.
error: A required dependency ‘libcrypto (libcrypto – OpenSSL cryptographic library)’ is still missing.
error: A required dependency ‘sane (SANE – Scanning library)’ is still missing.
error: Installation cannot continue without these dependencies.
error: Please manually install this dependency and re-run this installer.
Hi Flavio, it seems that are missing some dependencies on your OS.
Please try to install all of them running:
sudo apt install build-essential
sudo apt install libjpeg-dev
sudo apt install libtool-bin
sudo apt install libpthread-stubs0-dev
sudo apt install libusb
sudo apt install libsnmp-dev
sudo apt install openssl
sudo apt install sane
sudo apt install sane-utils
Then try again to install hplip and let me know.
while running hp-plugin I get the error reported here below.
How to do?
Thanks for help
Gabriele
———————————————-
P Linux Imaging and Printing System (ver. 3.20.3)
Plugin Download and Install Utility ver. 2.1
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.
HP Linux Imaging and Printing System (ver. 3.20.3)
Plugin Download and Install Utility ver. 2.1
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.
Checking for network connection…
Downloading plug-in from:
Traceback (most recent call last):
File “/usr/share/hplip/ui5/plugindialog.py”, line 248, in NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File “/usr/share/hplip/installer/pluginhandler.py”, line 254, in download
core = core_install.CoreInstall()
File “/usr/share/hplip/installer/core_install.py”, line 239, in __init__
self.passwordObj = password.Password(ui_mode)
File “/usr/share/hplip/base/password.py”, line 88, in __init__
self.__readAuthType() # self.__authType
File “/usr/share/hplip/base/password.py”, line 110, in __readAuthType
distro_name = get_distro_name().lower()
File “/usr/share/hplip/base/password.py”, line 78, in get_distro_name
return distro.linux_distribution(full_distribution_name=False)[0]
File “/usr/lib/python3/dist-packages/distro.py”, line 122, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File “/usr/lib/python3/dist-packages/distro.py”, line 677, in linux_distribution
self.version(),
File “/usr/lib/python3/dist-packages/distro.py”, line 737, in version
self.lsb_release_attr(‘release’),
File “/usr/lib/python3/dist-packages/distro.py”, line 899, in lsb_release_attr
return self._lsb_release_info.get(attribute, ”)
File “/usr/lib/python3/dist-packages/distro.py”, line 552, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File “/usr/lib/python3/dist-packages/distro.py”, line 1012, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File “/usr/lib/python3.8/subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.8/subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
PermissionError: [Errno 13] Permesso negato: ‘/var/crash/_usr_share_hplip_plugin.py.1000.crash’
Original exception was:
Traceback (most recent call last):
File “/usr/share/hplip/ui5/plugindialog.py”, line 248, in NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File “/usr/share/hplip/installer/pluginhandler.py”, line 254, in download
core = core_install.CoreInstall()
File “/usr/share/hplip/installer/core_install.py”, line 239, in __init__
self.passwordObj = password.Password(ui_mode)
File “/usr/share/hplip/base/password.py”, line 88, in __init__
self.__readAuthType() # self.__authType
File “/usr/share/hplip/base/password.py”, line 110, in __readAuthType
distro_name = get_distro_name().lower()
File “/usr/share/hplip/base/password.py”, line 78, in get_distro_name
return distro.linux_distribution(full_distribution_name=False)[0]
File “/usr/lib/python3/dist-packages/distro.py”, line 122, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File “/usr/lib/python3/dist-packages/distro.py”, line 677, in linux_distribution
self.version(),
File “/usr/lib/python3/dist-packages/distro.py”, line 737, in version
self.lsb_release_attr(‘release’),
File “/usr/lib/python3/dist-packages/distro.py”, line 899, in lsb_release_attr
return self._lsb_release_info.get(attribute, ”)
File “/usr/lib/python3/dist-packages/distro.py”, line 552, in __get__
ret = obj.__dict__[self._fname] = self._f(obj)
File “/usr/lib/python3/dist-packages/distro.py”, line 1012, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File “/usr/lib/python3.8/subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.8/subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
Hi Gabriele. It seems to be a permission issue (maybe could be also related with the python version??). I’ve never run into this problem and actually I cannot reproduce it (can you provide more information about the version of os, printer and python?). Anyway here I found some interesting threads where you can take a look:
https://stackoverflow.com/questions/44967202/pip-is-showing-error-lsb-release-a-returned-non-zero-exit-status-1
https://forum.ubuntu-it.org/viewtopic.php?f=9&t=642007&start=20
https://developers.hp.com/hp-client-management/forum/hp-laserjet-mfp-m28-hplip-3209-notworking-scanner?language=en
https://forums.linuxmint.com/viewtopic.php?t=271178
What you can try to do: check that the printer is supported by hplip driver, uninstall and purge everything and reinstall trying to change the connection method during the driver setup.
Please share here your solution if you find the fix! ๐
Hi Edo
On ubuntu 22.04 the printer works fine but scanner doesn’t.
I get this message:
error: SANE: Error during device I/O (code=9).
It seems starts to scanning but cannot saves the output.
Thanks
Hi, I’ve never run into this problem, anyway I can suggest you to reinstall the hplip plugin -> https://developers.hp.com/sites/default/files/hplip-3.22.10-plugin.run
Hi Edo
I resolved it. The problem was chosing the wrong option:
SELECT DEVICE
0* hpaio:/net/HP_LaserJet_MFP_M28-M31?ip=192.168.1.10
1 escl:https://192.168.1.10:443
2 airscan:e0:HP LaserJet MFP M28w (CFCE6D).
The right one for me is just option (1).
Now the printer and scann work very well. Thanks very much.
I am installing HPLIP on UBUNTU 22.04 . I have used HPLIP 3.22.xx because older versions are not able to find a qt library .
With HPLIP 3.22.6 and 3.22.10 I am able to install the software but the plugin keeps reinstalling because does not find a python library. I have found a turnaround:
I have installed apparmor utilities and permitted access to the net to plugin.py
sudo apt-get install apparmor-utils
sudo aa-disable /usr/share/hplip/plugin.py
and then I run
hp-pluginย ย
This solves the problem but it is necessary a patch to hplip
Thank you very much for this hint. It could be very useful for other users! ๐
Hi Edorado,
I’m impressed by your expertise.
As a novice Linux Ubunto user [Pop!_OS 22.04 LTS Ubunto] and trying to configure HP LJ Pro MFP M281fdw printer].
I am too uncomfortable with all options [and scared to death] that I might break my system.
Now somehow it seems to work however printing slowly.
What tests do suggest I perform to see if it is all installed correctly?
Hello Alex and thank you very much! I’m happy you installed everything and now it seems that everything is working correctly. Anyway, if you want to test the printer I can simply suggest you to print and scan some documents! If everything works as expected you don’t have to worry about anything! ๐