HPLIP cannot install on Ubuntu 21.04

Solution 1:

You can install hplip using the following command on Ubuntu 21.04

sudo apt-get install hplip hplip-gui

This may not give the latest version. To install latest version, first remove python2 and restart.

sudo apt-get install python-is-python3
sudo apt-get autoremove --purge
reboot

While running cmake, I got issues about missing dependencies. Install these dependencies with the following command.

sudo apt-get install libavahi-core-dev

Then download the installer from https://developers.hp.com/hp-linux-imaging-and-printing/gethplip and run it. Use one of the embedded script or the tarball.