Operating System: Ubuntu 19.04 Fresh Install
This is a duplicate of a post I put on the HP forum as well.
The built-in drivers from Ubuntu failed to make my color laser printer even flicker, and trying to install drivers from the HP site gives:
“If you need to download Linux drivers, you will be directed to a website that is outside HP Customer Support.”
I don’t know why HP won’t provide their own drivers on their own site like they do for windows users, but whatever.
The driver (hplip 3.19.8) from the sourceforge page they send you to is tragically bad, and I have wasted more hours trying to get it to work than I care to admit. A sane person would have already returned the printer.
However… I was finally able to make progress today, and as I am finding scores of posts online about this same issue, I have decided to post my sort-of-working solution. Perhaps someone smarter than I can finish what I have started; the following at least makes it possible to get some level of functionality.
Side note – Plugging the printer into a Windows machine at work proved that the printer itself works perfectly. 10 minutes from start to finish, including setting up wireless printing. It would have taken less time, but I wasn’t aware it was already done, and I spent a couple of minutes trying to “finish” setting it up before realizing there was nothing else needed… it just worked..
First step, which in hindsight is likely unnecessary: Do a full wipe and re-install Ubuntu 19.04. This was my nuclear option; nothing else had worked at all, and I fully believed there was some other issue on my system preventing the printer from working. As I said, this step is likely unnecessary.
Second step, also likely unnecessary, but again… it is what I did after coming to the conclusion that somehow the new driver had screwed up something on the printer, so it may be necessary, maybe not: Factory reset your printer. In my case, this is done by Unplugging the printer from the wall for a minimum of 30 seconds. Then plug it in, then hold down the “reset” button on the printer (On mine it looks like a little folded-over piece of paper with an arrow on it.) While holding it down, press and release the power button. Keep holding down the reset button while the printer powers up, it takes about 10-15 seconds. When the yellow/orange triangle+exclamation point light turns on steadily, release the reset button. Wait a few minutes until it is done making noise. You are now factory reset. (Some models say that you have to hold down the reset AND the cancel buttons, yours may be different) You can plug the printer into your computer via the USB connection at this point as well.
Then… and as far as I have been able to figure out, the remaining steps are necessary.
Launch a terminal window. I simply use Ctrl+Alt+T, but you can also find it in the launcher menu under “Terminal.”
In the terminal window, type (or copy-paste) the following (all on one line:)
sudo apt-get purge hplip hplip-data hplip-doc hplip-gui hpijs-ppds libsane-hpaio printer-driver-hpcups printer-driver-hpijsA
This will remove almost all of the leftover drivers and droppings from any previous installs or failed attempts.
sudo rm -rf /usr/share/hplip/
will remove the rest of them.
sudo apt-get autoremove
will get rid of anything that wasn’t removed in the previous steps, or that is no longer required now that the previous drivers have been released.
At this point, it’s a good idea to do:
sudo apt update
sudo apt upgrade
then reboot; repeat the previous update to ensure no new updates are available. This just ensures there isn’t some random outdated file that it needs
Then, return to a terminal window if you rebooted.
sudo apt install libgail-common
sudo apt install libcanberra-gtk-module
(I know you can combine commands; I’m just reporting it exactly as I entered it.)
These 2 items constantly showed as missing; for some reason the driver didn’t install them despite being required dependent lib files.
sudo apt-get install apparmor-utils
sudo aa-disable /usr/share/hplip/plugin.py
This will disable apparmor’s protection for another necessary file.
The driver requires this additional file, from another totally different source, but their keyserver is borked and won’t authenticate the additional file. Disabling apparmor’s protection is the only way I could get it to allow installing this file properly.
sudo apt install hplip
sudo apt install hplip-gui
This will install the latest drivers from the Ubuntu archives.
After they install, do:
hp-setup -g &> ~/hp-setup.log
This will run the setup program – note that even though this is all done through terminal, it will still launch a gui. I know.
Go through all of the steps; it will fail with errors… or it might succeed, but still with errors.
Close the installer, then in terminal do:
cat ~/hp-setup.log | grep "file is not present"
This will return a potentially huge list of “missing” files. They are not actually missing, but the driver does not look in the proper place to find them.
To locate the correct location, do:
(I chose that file at random from the list of ‘missing’ files, but it gives the correct path to find the actual locations.)
Note the path to find those files, then create a link to those files by doing:
sudo ln -s /usr/lib /usr/lib/i386-linux-gnu
sudo ln -s /usr/lib64 /usr/lib64/x86_64-linux-gnu
Thiss will let the driver keep looking in the wrong places, by pointing it to the actual places.
Then repeat the commands:
hp-setup -g &> ~/hp-setup.log
cat ~/hp-setup.log | grep "file is not present"
and make certain there are no further “missing” files identified.
sudo chmod 644 /etc/cups/ppd
For some reason, the installation script doesn’t grant the correct permission to install everything properly. This step might could be done earlier, but I didn’t feel like starting completely over yet again just to see.
Then, to verify the whole thing was successful, do:
This will return an interesting report:
warning: ubuntu-19.04 version is not supported. Using ubuntu-18.10 versions dependencies to verify and install…
warning: HPLIP-Installation: Auto installation is not supported for ubuntu distro 19.04 version
No errors or warnings.
Yes – I got multiple warnings, but it returned that there were no errors or warnings. I don’t know what to make of that at all, nor how to correct it.
It’s a good idea to reboot at this point, just to make certain everything is playing nice from a fresh boot.
You can also do this from the HP app that is installed; I do it from terminal to watch for more errors and such. It really doesn’t return anything useful though.
Wait a while for it to fully populate all of the available actions. For some reason it takes a few minutes to do so, and it also says the printer has “unknown status.”
Try “Print test page” I get a test page, but the quality is crap – it looks like an inkjet printed it on wet paper… which is why I said that this is a “sort-of” solution.
At this point, you should also be able to print from other applications as well. Again – the quality on mine is horrible, but it is at least doing something… which is more that it has done for countless hours of trying to get the futhermucking driver to work. This is probably because of the non-error about it not being compatible with 19.04, but whatever. I’m just thrilled it is doing anything at all.
Also at this point, you can try to get the wireless functionality to work. Another post on here said that after many hours of trying to get theirs to work that the wireless functionality is not available on Linux, which should have prepared me for my experience…
I was not successful; it gets to step 4, waits for the printer to connect to the network, and then just hangs. I’ve let it sit and spin 8 or 10 times, for as long as 45 minutes, but it just stops. As I said, perhaps someone smarter than I will be able to figure out the rest of the steps necessary to make this thing work.
This is all the things I know, I hope it gets you pointed in the right direction.
I am fully aware that manually doing chmod in the etc folder is a bad bad bad practice, but that’s what it took.
I am also aware that manually bypassing apparmor is also a no-no of epic proportion, but again… nothing else has worked at all.
Best of luck.