Avoid needing root password for hplip scanner plug-in install

I’m just writing this down to remind myself and hopefully saving some others some pain.
Some (all?) HP scanners requires a proprietary plug-in to be installed, prompting you to do so if you try to use a scanner application while HP Device Manager is running. Unfortunately, unless otherwise specified in /usr/share/hplip/base/password.py, it annoyingly defaults to asking for a root password with no graphical way of telling it to use a user/sudo password instead. This can be fixed by editing password.py:

sudo nano /usr/share/hplip/base/password.py

And adding

‘endeavouros’ : ‘sudo’,

Under AUTH_TYPES

how are your groups settings, you are a member of scanner ?

~$ groups
sys realtime plugdev rfkill users wheel myusername

No, everything works fine now, though

i use simple scan on mly wife pc seems also no scanner haha… but no password just lp cups wheel rest idk know difference

Yeah, I don’t really know the difference either =) Simple scan is really nice, though. I even use it on KDE

I’ve had the same problem with refusal of HPLIP to install the scanner plugin because my root password is not recognised. Not being a Python programmer, unfortunately, I can’t see where in the “password.py” file you add the mention of endeavouros.

The AuthType variable appears in a number of places, but I can’t see any AUTH_TYPES at all. The only mention of OS names “arch” is linked to “manjarolinux” for some strange reason.

Open a terminal copy and paste the above line into it, press enter. Looks like something has changed since this was posted. I no longer have an HP printer, but still have hplip installed from when I did.

You could try changing line 59 to:

   elif "endeavouros" in os_name:
        os_name = 'manjarolinux' 

from “arch” to “endeavouros” no guarantees…

Thanks for the suggestion, but unfortunately it still doesn’t work with that os name change.

I’ve just switched to another desktop I have with MX-Linux and set up the the HP deskjet I have wiht no problem. On trying to scan the hplip manager started to download the plugin as on EndeavourOS but curiously when it asked for permission to install it had “root” preinserted instead of my username. The iinstallation completed and I can use the scanner.

I wonder if this is not part of the problem as the python password script seems to check on whether the user has sudoer rights or not, but it’s probably more complicated than that as it seems that Ubuntu doesn’t allow this, whereas most other OS do. So I imagine this is what the script is supposed to detect.

I guess I’ll have to start learning python - a long-promised task - to find out where the AuthType variable is not picking up the fact that EndeavourOS works like Arch (or Manjoro for that matter). It’s strange because an earlier version of hplip went through the same procedure of downloading the plugin to get the scanner working, and there was no problem of refused pernission.

BTW the hplip device manager version is 3.23.3 which is the latest one available I believe.

Solved my problem :grinning:
I compared the two password.py files on my endeavouros to the one on my mxlinux desktop and discovered that there is a section missing in the file on my EOS which declares the AUTH_TYPES variable followed by a list of various Linux OS distros so @Claritux was right. I only needed to insert the line at the end of the list before the closing curly brace:

‘endeavouros’: ‘sudo’,

And, hey presto! It worked, asking for my root password to complete the plugin installation. Scanner working now!

HP have changed their password file for the scanner plugin update. Here’s what I discovered.

Examining the Python script used in password.py as described above I noticed that the section AUTH_TYPES to identify the distro had disappeared from the beginning of the script.

Instead the creator of the script seems to use a shorter section to define the distro class according to the method of getting root permissions to install the scanner plugin.

Under the line “def get_distro_std_name(os_name)” you need to insert an alternative “elif” to tell the later authorisation function that EndeavourOS uses the same elevation of user rights as Manjaro; i.e. using “sudo”:

elif "endeavouros" in os_name:
   os_name = 'manjarolinux'

Now when HPLIP finds that the scanner plugin needs to be updated it will download it and ask the user for his password providing he is in the sudo,wheel group.

Hope this information might be useful to those using HPLIP.