How to Install HPLIP on Ubuntu 22.04 | 20.04

Hewlett-Packard Linux Imaging and Printing (HPLIP) is a versatile and powerful solution designed to enhance the printing, scanning, and faxing experience for HP devices on Linux systems. Ubuntu users can significantly benefit from installing HPLIP, as it provides an all-in-one package for managing their HP devices efficiently.

Why Ubuntu Users Should Consider Installing HPLIP:

  • Device Compatibility: HPLIP supports over 3,000 HP printer models, including DeskJet, OfficeJet, Photosmart, PSC, Business Inkjet, LaserJet, and more. With such extensive coverage, chances are high that your HP device will be supported.
  • Feature-Rich: HPLIP offers a comprehensive suite of functionalities, such as the automatic discovery of network printers, print spooler integration, and extensive printing options like duplex printing, borderless printing, and color calibration.
  • Scan and Fax Support: Along with printing, HPLIP also provides support for scanning and faxing, enabling seamless integration of multi-function HP devices with your Ubuntu system.
  • Regular Updates: HPLIP receives constant updates from HP, ensuring the software stays up-to-date with the latest device drivers, bug fixes, and performance improvements.
  • GUI Tools: HPLIP comes with a user-friendly graphical interface (HP Device Manager) that simplifies the management of your HP devices. This makes configuring settings, troubleshooting issues, and performing maintenance tasks easy.
  • Open Source: HPLIP is an open-source project, which means it’s free to use and benefits from community contributions and improvements.

With these advantages, Ubuntu users can significantly improve their experience using HP devices on their systems. The following guide will demonstrate how to install HPLIP on Ubuntu 22.04 Jammy Jellyfish or Ubuntu 20.04 Focal Fossa using a well-known PPA that maintains the latest package so you can easily keep on top of your drivers.

Section 1: Install HPLIP on Ubuntu Linux

Step 1: Update Packages

Before we begin the HPLIP installation, updating your system packages is crucial. This ensures that all existing packages are up-to-date and minimizes the chance of conflicts during the installation process. Run the following command in your terminal to update and upgrade your packages:

sudo apt update && sudo apt upgrade

Step 2: Install Required Packages

Next, we need to install some prerequisite packages that are necessary for the installation process. The software-properties-common package provides tools to manage distribution and software repositories, while the apt-transport-https package enables the use of repositories accessed via the HTTPS protocol. Run the following command to install or check if these packages are already installed:

sudo apt install software-properties-common apt-transport-https -y

Step 3: Download HPLIP

To install HPLIP, we will use a well-known Launchpad PPA maintained by Butterfly. This PPA is frequently updated and ensures access to the latest HPLIP package. To add this PPA to your system, run the following command:

sudo add-apt-repository ppa:kelebek333/hplip -y

Step 4: Update Package Index

After importing the HPLIP PPA, we must update the package index to include the new repository. This will allow your system to recognize the HPLIP package from the added PPA. Run the following command to update the package index:

sudo apt update

Step 5: Install HPLIP

With the PPA added and the package index updated, you can now proceed with installing HPLIP. Run the following command to install the HPLIP package on your Ubuntu system:

sudo apt install hplip hplip-gui

Section 2: Configuring and Testing HPLIP Basic Setup

After successfully launching HPLIP, it’s essential to configure and test the basic setup to ensure your HP devices are working correctly with the software. In this section, we will walk you through the process of configuring and testing your HP devices using HPLIP.

Step 1: Run HPLIP Setup

The setup process is similar whether you are using the CLI or GUI method to launch HPLIP. If you haven’t already, run the hp-setup command in the terminal or launch HPLIP via the GUI method as described in the previous section.


Example of HPLIP setup window on Ubuntu Linux:

Step 2: Select Connection Type

When the HPLIP setup window appears, you will be prompted to choose the connection type for your HP device. You can choose from USB, Network/Ethernet/Wireless, or Parallel. Select the appropriate connection type for your device and click “Next.”

Step 3: Discover and Select Your Device

HPLIP will now scan for connected HP devices based on the connection type you selected. If your device is not automatically detected, you may need to enter its IP address or hostname manually (for Network/Ethernet/Wireless connections). Once your device appears in the list, select it and click “Next.”

Step 4: Configure Printer Settings

In this step, you will configure the basic settings for your HP printer, such as the printer name and description. You can also choose to share the printer on your local network if desired. After configuring the settings, click “Next.”

Step 5: Install the Printer Driver

HPLIP will now prompt you to install the appropriate printer driver for your device. It will automatically select the recommended driver, but you can also choose a different driver from the list if needed. Click “Next” to begin the driver installation process.

Section 3: Testing HPLIP Installation

Once you have configured your HP devices using either the CLI or GUI method, it’s essential to test the installation to ensure that your devices are functioning correctly with HPLIP. In this section, we will provide instructions on testing your HPLIP installation for both printing and scanning tasks.

Step 1: Print a Test Page

To confirm that your HP printer is functioning correctly, it’s recommended to print a test page. This can be done through the HPLIP setup process or directly from your operating system.

CLI Method:

In your terminal, enter the following command, replacing “printer_name” with the name of your HP printer:

lp -d printer_name /usr/share/cups/data/testprint

GUI Method:

  1. Open the Printers application on your Ubuntu system.
  2. Locate and select your HP printer in the list of available printers.
  3. Right-click on the printer and choose Properties.
  4. In the printer properties window, click on the Print Test Page button.

If the test page prints successfully, your HP printer is properly set up and functioning with HPLIP.

Step 2: Test Scanning Functionality

If you have an HP all-in-one device with scanning capabilities, you can test the scanning functionality using HPLIP’s built-in scan utility.

CLI Method:

In your terminal, enter the following command to initiate a test scan:

hp-scan --output=my-test-scan.png

This command will create a test scan and save it as “my-test-scan.png” in your current working directory.

GUI Method:

  1. Launch the HPLIP Toolbox by searching for “HPLIP” in your application menu and clicking on the HPLIP Toolbox icon.
  2. In the HPLIP Toolbox window, locate and select your HP all-in-one device.
  3. Click on the Scan button to open the scanning utility.
  4. Follow the on-screen instructions to perform a test scan, adjusting the scan settings as needed.

If the test scan completes successfully, your HP all-in-one device’s scanning functionality is properly set up and working with HPLIP.

Example of HPLIP application icons on Ubuntu Linux:

Section 4: Additional HPLIP Commands with Ubuntu Linux

In this section, we will cover some useful HPLIP-related commands for Ubuntu users, such as updating HPLIP, removing HPLIP, and removing the HPLIP PPA repository.

Updating HPLIP

HPLIP should update automatically with your system packages if you are using the APT package manager on a desktop system. However, if you want to check for updates manually, you can use the following command in your terminal:

sudo apt update && sudo apt upgrade

This command will update your package index and upgrade the installed packages, including HPLIP, to their latest versions.

Removing HPLIP

If you no longer need HPLIP on your system, you can remove it using the following command:

sudo apt remove hplip

This command will uninstall the HPLIP software from your Ubuntu system.

Removing the HPLIP PPA Repository

After removing HPLIP, you may want to remove the HPLIP PPA repository as well, since it is no longer needed. The command to remove the repository is similar to the one used for adding it, but with the --remove syntax added. Enter the following command in your terminal to remove the HPLIP PPA repository:

sudo add-apt-repository --remove ppa:kelebek333/hplip -y

Conclusion: Installing HPLIP on Ubuntu Linux

In this guide, we’ve covered the essential steps to install HPLIP on Ubuntu Linux. We’ve walked you through updating your system packages, adding the HPLIP PPA repository, installing HPLIP, and managing the software using various commands. By following these steps, you can successfully set up your HP printer or scanner on your Ubuntu system and ensure optimal performance.

Additional Resources and Links

To further explore HPLIP and its capabilities, here are some official resources and documentation that you can refer to:

Comments are closed.

Share to...