Printer support on Linux can be a hit or miss. Vendors usually support the Windows and macOS platform, and they rarely have open-sourced their drivers. In the condition that the vendors have published the closed-source drivers, some Linux distribution maintainers might prefer not to ship it with their distribution because of the open-source philosophy. We had already covered the installation of Canon Printer drivers on Linux previously.
In this tutorial, we will try to install the HP printer drivers as well as their Imaging and Printing software on all the Linux-based distributions.
Downloading the HP Printer Installer Script
Visit the official HP website and then select your appropriate Linux distribution from the dropdown menu, and then click on the ‘Download HPLIP’ button.
You will be redirected to a SourceForge page, from where your
.run file will be downloaded. Once the download is finished, close your web browser and open a Terminal window.
Executing the HP Printer Installer Script
Open your terminal window and navigate to your Downloads’ directory using the cd command.
From here, you can run the installer script like this:
Do note that the version and name of the script might differ for you depending upon your distribution and time of installation.
From this script, read and answer all the questions correctly such as the installation procedure, your distribution name, its version etc. and then type your admin password. The installer will then compile and install your required drivers.
You might have noticed the error in the first screenshot, that happened because I am using Nobara Linux 38, which is based on Fedora 38. The Official script does not seem to be updated after 2022 and Fedora 38 was not an option in the script. Thankfully, Nobara ships ‘HPLIP’ and ‘HPLIP-GUI’ packages in their official repository, and you can install them by typing:
sudo dnf install hplip hplip-gui
Once the drivers are installed, you can simply plug in your Printer to the PC and then launch the GUI application.
From this application, you can add/remove and configure your Printer devices.
Command Line Configuration for HP Printers
If you do not like using the GUI application, then you can also configure your printers directly from the Terminal. Just type the following command:
You will be asked to select the medium through which your Printer is connected to your PC (USB, Ethernet or through the Wireless network). Select the appropriate option and then hit enter.
Now, your printer will be detected and make sure to select the correct one and then proceed. You can now enter a custom name for your printer, and you will be done!
Conclusion and Recommendations
There’s a URL in the script which redirects to a broken HP website when you run the script on an ‘unsupported’ Linux distribution. That is not astounding, as mega-corporations rarely try to maintain their Desktop applications and scripts on Linux because of its low market share. On the Server side, however, Linux is highly maintained by the same companies.
It is therefore recommended that you should check your distribution’s package manager (or Software center) for the HPLIP and HPLIP-GUI packages before running the script from the official HP website. Make sure that you enable the Universe repository in Ubuntu and RPM fusion in the Fedora workstation before searching for packages.
If you are looking for a Manual installation guide from HP officially, visit this website instead of the broken link mentioned in the script.