I installed hplip and hplip-data. Then I started HPLIP Toolbox GUI. I click add printer and then I get a message (see pic) that PPD file is not found. When I click browse I find some .gz file and none of them solve the issue if selected.
Then
My Ubuntu is Ubuntu 18.04
The output of apt-cache policy hplip hplip-gui:
hplip:
  Installed: 3.17.10+repack0-5
  Candidate: 3.17.10+repack0-5
  Version table:
 *** 3.17.10+repack0-5 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
hplip-gui:
  Installed: 3.17.10+repack0-5
  Candidate: 3.17.10+repack0-5
  Version table:
 *** 3.17.10+repack0-5 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
        100 /var/lib/dpkg/status
Following this post, I did:
sudo apt-get install hplip-guihp-setup
I get a GUI for HP Device Manager. My printer is connected by USB. So I select USB then Next. Then I move to another page with title Select from Discovered Device, which shows my printer listed. I click on my printer and Next. Then I get this in the terminal.
HP Linux Imaging and Printing System (ver. 3.17.10)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-15 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.
Searching... (bus=usb, search=(None), desc=0)
error: No PPD found for model deskjet_2540 using old algorithm.
error: No appropriate print PPD file found for model deskjet_2540_series

