How to Install Latest Hplip on the Ubuntu to Support the HP Printer And/or Scanner in Ubuntu?
Tags: ubuntu
Published: 2021-12-01 16:33:28

---
title: How to Install Latest Hplip on the Ubuntu to Support the HP Printer And/or Scanner in Ubuntu?
published: true
date: 2021-11-25 16:58:46 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-install-latest-hplip-on-the-ubuntu-to-support-the-hp-printer-and-or-scanner-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">hp</span><span style="font-size: 1.2em; color: initial;">package-management</span><span style="font-size: 1.2em; color: initial;">printing</span></p>
</header>

Let’s assume that one has some modern HP printer and/or scanner which is not supported by HPLIP package from official repository.

Currently Ubuntu versions have [the following versions in _universe_ pocket](https://packages.ubuntu.com/search?suite=all&exact=1&searchon=names&keywords=hplip-gui):

> ```
> trusty (14.04LTS) (utils): 3.14.3-0ubuntu3.4
> xenial (16.04LTS) (utils): 3.16.3+repack0-1
> bionic (18.04LTS) (utils): 3.17.10+repack0-5
> focal (20.04): 3.20.3+dfsg0-2
> groovy (20.10): 3.20.5+dfsg0-3build1
> 
> ```

What can one do if printer is supported in newer version of HPLIP (checked this in [_HP Developer Portal | All Supported Printer Models_](https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index))?

#### Accepted Answer

# Installation

Currently there are no PPAs with newer `hplip` packages.

But user can download and install binary from HP as described in [their manual](https://developers.hp.com/hp-linux-imaging-and-printing/install/install/index).

_ **Before you proceed you should remove any `hplip` related packages to avoid possible future conflicts.** _

HP have note about this problem on [support page](https://developers.hp.com/hp-linux-imaging-and-printing/install/step3/index):

> 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 and 18.04 LTS) 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:

1. **Step 1: Download the Automatic Installer (.run file)** from [official link](https://developers.hp.com/hp-linux-imaging-and-printing/gethplip) for the Ubuntu or as for today using `wget`
```
wget https://download.sourceforge.net/project/hplip/hplip/3.21.2/hplip-3.21.2.run

```
2. **Step 2: Run the Automatic Installer**
```
sh hplip-3.21.2.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](https://developers.hp.com/hp-linux-imaging-and-printing/install/install/index).

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 installation file `hplip-3.21.2.run` in the current directory. We need to extract archive from it and then run uninstallation script.

```
sh hplip-3.21.2.run --noexec
cd hplip-3.21.2
sudo python3 ./uninstall.py
sudo rm -rf /usr/share/hplip/

```

Afterwards we install official Ubuntu packages instead (optionally):

```
sudo apt-get install hplip-gui

```

* * *

Note: I have reported [bug 1782137](https://bugs.launchpad.net/hplip/+bug/1782137) to HPLIP’s LaunchPad account asking developers to include uninstallation feature of deb-packages HPLIP components from Ubuntu.

The post [How to Install Latest Hplip on the Ubuntu to Support the HP Printer And/or Scanner in Ubuntu?](https://stackallflow.com/ubuntu/how-to-install-latest-hplip-on-the-ubuntu-to-support-the-hp-printer-and-or-scanner-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).