Ubuntu 16.04: HPLIP installer does not accept the root password.

Asked by Harald Detering

When trying to upgrade to HPLIP 3.17.9 on Ubuntu 16.04.03 the text UI tells me I entered the wrong root password. After 3 trials it aborts. Earlier in the process, the installer detected my Linux distribution as "debian, stretch/sid" which I corrected using the downstream dialog. Since Debian uses "su" to run processes with root permissions, whereas Ubuntu uses "sudo", I suspect that the erroneous distribution detection may be involved in the abort.

On closer inspection, it seems that, internally, the installer uses the "platform" module to detect the distribution, which detects my installation incorrectly:
---
$ python3
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.dist()
('debian', 'stretch/sid', '')
---

Apparently, the "platform.dist()" function is now deprecated and will be removed in Python3.7:
https://docs.python.org/3/library/platform.html#unix-platforms

An alternative for could be "distro" (https://pypi.python.org/pypi/distro), which returns the same format and detects the distribution correctly:
---
$ python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import distro
>>> distro.linux_distribution()
('Ubuntu', '16.04', 'Xenial Xerus')
---

To verify that the installer works with that package I

1. ran the installer with the "--confirm" option,
2. let it unpack the files into a local folder,
3. replaced the corresponding lines in 2 files:

lines 598-600 in hplip-3.17.9/installer/core_install.py:
---
import distro
name = distro.linux_distribution()[0].lower()
ver = distro.linux_distribution()[1]
---

lines 78-79 in hplip-3.17.9/base/password.py:
---
import distro
os_name = distro.linux_distribution()[0]
---

4. confirmed that the install script should be run.

Which successfully installed the new HPLIP version.

In conclusion, you might consider replacing the "platform" module for PyPi's "distro" wherever it is used in the installer.

Question information

Language:
English Edit question
Status:
Expired
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.