hplip plugin installer fails 20.04LTS

Asked by Allan W. Macdonald on 2021-04-11

After upgrading to 20.04LTS, my HP-LaserJet 1018 printer stopped printing. Looking at the logs, I found the following errors:
E [04/Apr/2021:12:12:55] common/utils.c 177: validate_plugin_version() Plugin version[3.17.10] mismatch with HPLIP version[3.20.3]
E [04/Apr/2021:12:12:55] common/utils.c 210: Plugin version is not matching

Strange. I tried completely purging and re-installing the hplip package and the problem still exists. So, I decided to try a more drastic approach: install the correct plugin outside of the package manager process.

I went here:
https://developers.hp.com/hp-linux-imaging-and-printing/plugins
and downloaded:
hplip-3.20.3-plugin.run
(I presume that the plugin version should match the dpkg version)

But when I try to run it, I get the following error:
$ sh hplip-3.20.3-plugin.run
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................
Error setting home directory: /etc/hp/hplip.conf not found. Is HPLIP installed?
$

I googled around and tried all kinds of different things - I tried purging the hplip package and installing the binary installer dirctly from HP but that had problems with dependencies that I was unable to resolve easily so I gave up on that.

Not sure what to do next.

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

I suggest that you uninstall all versions of hplip and then install the version from the Ubuntu repositories (which is a modified version of 3.20.3 to cope with the dependency problems) and then install the plugin in the same version from the developers.hp.com web page.

Sorry if I didn't make that clear but I did that already. Nevertheless, I just repeated the whole thing again, capturing all output for the benefit of completeness:

First purge hplip:

$ sudo apt remove --purge 'hplip*'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'hplip-data' for glob 'hplip*'
Note, selecting 'hplip' for glob 'hplip*'
Note, selecting 'hplip-doc' for glob 'hplip*'
Note, selecting 'hplip-gui' for glob 'hplip*'
Note, selecting 'hplip-cups' for glob 'hplip*'
Note, selecting 'hplip-ppds' for glob 'hplip*'
Package 'hplip-cups' is not installed, so not removed
Note, selecting 'hpijs-ppds' instead of 'hplip-ppds'
Package 'hplip' is not installed, so not removed
Package 'hplip-data' is not installed, so not removed
Package 'hplip-doc' is not installed, so not removed
Package 'hplip-gui' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ sudo rm -rf /usr/share/hplip

Now, make sure it really is gone:

$ ps -ef | grep hpl
usernam+ 57212 2837 0 09:57 pts/0 00:00:00 grep --color=auto hpl
$ find /bin -name "*hp*"
$ find /usr/bin -name "*hp*"
/usr/bin/foo2hp2600-wrapper
/usr/bin/arm2hpdl
/usr/bin/foo2hp
$ find /usr/local/bin -name "*hp*"
$ find /usr -name "*hpl*"
/usr/share/applications/hplj1020.desktop
/usr/share/purpose/bluetoothplugin_config.qml
/usr/share/man/man5/sane-hpljm1005.5.gz
/usr/share/foo2zjs/hplj1020_icon.gif
/usr/share/foo2zjs/hplj10xx_gui.tcl
/usr/share/app-install/desktop/printer-driver-foo2zjs-common:hplj1020.desktop
/usr/share/app-install/desktop/hplip-gui:hplip.desktop
/usr/share/app-install/desktop/flashplugin-installer.desktop
/usr/share/app-install/desktop/stretchplayer:stretchplayer.desktop
/usr/share/app-install/icons/adobeflashplugin.png
/usr/share/app-install/icons/_usr_share_stretchplayer_icons_stretchplayer-icon-48x48.png
/usr/share/app-install/icons/_usr_share_pixmaps_hplj1020_icon.png
/usr/share/pixmaps/hplj1020_icon.png
/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/purpose/bluetoothplugin.so
/usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqtuiotouchplugin.so
/usr/lib/x86_64-linux-gnu/qt5/plugins/generic/libqevdevtouchplugin.so
/usr/lib/x86_64-linux-gnu/sane/libsane-hpljm1005.so.1
/usr/lib/x86_64-linux-gnu/sane/libsane-hpljm1005.so.1.0.29
/usr/lib/x86_64-linux-gnu/sane/libsane-hpljm1005.a
/usr/lib/x86_64-linux-gnu/sane/libsane-hpljm1005.so
/usr/lib/thunderbird/distribution/searchplugins
/usr/lib/thunderbird/searchplugins
/usr/lib/thunderbird-addons/searchplugins

Looks OK, now install again:

$ sudo apt update
Hit:1 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://ppa.launchpad.net/system76-dev/stable/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
$ sudo apt install hplip
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  hplip-data libhpmud0 libsane-hpaio printer-driver-hpcups printer-driver-postscript-hp
Suggested packages:
  hplip-doc hplip-gui
The following NEW packages will be installed:
  hplip hplip-data libhpmud0 libsane-hpaio printer-driver-hpcups printer-driver-postscript-hp
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,252 kB of archives.
After this operation, 16.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 hplip-data all 3.20.3+dfsg0-2 [6,427 kB]
Get:2 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 libhpmud0 amd64 3.20.3+dfsg0-2 [107 kB]
Get:3 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 libsane-hpaio amd64 3.20.3+dfsg0-2 [126 kB]
Get:4 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 printer-driver-hpcups amd64 3.20.3+dfsg0-2 [266 kB]
Get:5 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 hplip amd64 3.20.3+dfsg0-2 [204 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 printer-driver-postscript-hp amd64 3.20.3+dfsg0-2 [1,122 kB]
Fetched 8,252 kB in 1s (10.3 MB/s)
Selecting previously unselected package hplip-data.
(Reading database ... 303132 files and directories currently installed.)
Preparing to unpack .../0-hplip-data_3.20.3+dfsg0-2_all.deb ...
Unpacking hplip-data (3.20.3+dfsg0-2) ...
Selecting previously unselected package libhpmud0:amd64.
Preparing to unpack .../1-libhpmud0_3.20.3+dfsg0-2_amd64.deb ...
Unpacking libhpmud0:amd64 (3.20.3+dfsg0-2) ...
Selecting previously unselected package libsane-hpaio:amd64.
Preparing to unpack .../2-libsane-hpaio_3.20.3+dfsg0-2_amd64.deb ...
Unpacking libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
Selecting previously unselected package printer-driver-hpcups.
Preparing to unpack .../3-printer-driver-hpcups_3.20.3+dfsg0-2_amd64.deb ...
Unpacking printer-driver-hpcups (3.20.3+dfsg0-2) ...
Selecting previously unselected package hplip.
Preparing to unpack .../4-hplip_3.20.3+dfsg0-2_amd64.deb ...
Unpacking hplip (3.20.3+dfsg0-2) ...
Selecting previously unselected package printer-driver-postscript-hp.
Preparing to unpack .../5-printer-driver-postscript-hp_3.20.3+dfsg0-2_amd64.deb ...
Unpacking printer-driver-postscript-hp (3.20.3+dfsg0-2) ...
Setting up hplip-data (3.20.3+dfsg0-2) ...
Setting up printer-driver-postscript-hp (3.20.3+dfsg0-2) ...
Setting up libhpmud0:amd64 (3.20.3+dfsg0-2) ...
Setting up libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
Setting up printer-driver-hpcups (3.20.3+dfsg0-2) ...
Setting up hplip (3.20.3+dfsg0-2) ...
Creating/updating hplip user account...
Can't open /etc/hp/hplip.conf: No such file or directory.
Can't open /etc/hp/hplip.conf: No such file or directory.
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Processing triggers for cups (2.3.1-9ubuntu1.1) ...

Installation seems OK. Now install the plugin from a link obtained here: https://developers.hp.com/hp-linux-imaging-and-printing/plugins/hplip-3.20.3-plugin.run

$ wget https://developers.hp.com/sites/default/files/hplip-3.20.3-plugin.run
--2021-04-12 10:25:49-- https://developers.hp.com/sites/default/files/hplip-3.20.3-plugin.run
Resolving developers.hp.com (developers.hp.com)... 34.210.182.99, 35.167.236.162
Connecting to developers.hp.com (developers.hp.com)|34.210.182.99|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11514166 (11M)
Saving to: ‘hplip-3.20.3-plugin.run.1’

hplip-3.20.3-plugin.run.1 100%[=============================================>] 10.98M 9.01MB/s in 1.2s

2021-04-12 10:25:51 (9.01 MB/s) - ‘hplip-3.20.3-plugin.run.1’ saved [11514166/11514166]

$ sh hplip-3.20.3-plugin.run
erifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................
Error setting home directory: /etc/hp/hplip.conf not found. Is HPLIP installed?
$

Whoops! This URL "https://developers.hp.com/hp-linux-imaging-and-printing/plugins" should not have had "/hplip-3.20.3-plugin.run" appended at the end!

Manfred Hampl (m-hampl) said : #4

What is the output of the commands

find /etc -name "*hp*"
ls -l /etc/hp/
dpkg -L libsane-hpaio | grep conf

$ sudo find /etc -name "*hp*"
[sudo] password for username:
/etc/cron.d/php
/etc/dbus-1/system.d/com.hp.hplip.conf
/etc/sane.d/dll.d/hplip
/etc/sane.d/hp3900.conf
/etc/sane.d/hp.conf
/etc/sane.d/hp5400.conf
/etc/sane.d/hpsj5s.conf
/etc/sane.d/hp4200.conf
/etc/systemd/system/phpsessionclean.timer
/etc/systemd/system/timers.target.wants/phpsessionclean.timer
/etc/apparmor.d/abstractions/php
/etc/apparmor.d/abstractions/php5
/etc/php
/etc/php/7.2/cli/php.ini
/etc/pam.d/chpasswd
/etc/hp
/etc/gufw/app_profiles/hplip.gufw_app
$ ls -l /etc/hp/
total 0
$ dpkg -L libsane-hpaio | grep conf
/etc/hp/hplip.conf
$

Manfred Hampl (m-hampl) said : #6

What happen with the installation of the libsane-hpaio package? This package should have installed the /etc/hp/hplip.conf file, but it is not there!

What output do you receive for the commands

sudo apt install --reinstall libsane-hpaio
ls -l /etc/hp/

$ sudo apt install --reinstall libsane-hpaio
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 126 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 libsane-hpaio amd64 3.20.3+dfsg0-2 [126 kB]
Fetched 126 kB in 0s (477 kB/s)
(Reading database ... 303799 files and directories currently installed.)
Preparing to unpack .../libsane-hpaio_3.20.3+dfsg0-2_amd64.deb ...
Unpacking libsane-hpaio:amd64 (3.20.3+dfsg0-2) over (3.20.3+dfsg0-2) ...
Setting up libsane-hpaio:amd64 (3.20.3+dfsg0-2) ...
$ ls -l /etc/hp/
total 0
$

Manfred Hampl (m-hampl) said : #8

This is unexpected. I have no clue why the file is not installed.

Is there anything in the system logs?

dmesg | tail
dmesg | grep hp

$ sudo dmesg | grep hp
[ 0.109506] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484882848 ns
[ 0.142352] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[ 0.170752] acpiphp: Slot [1] registered
[ 0.174847] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0, 0, 0, 0, 0
[ 0.174847] hpet0: 8 comparators, 64-bit 14.318180 MHz counter
[ 0.364980] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[ 0.411819] rtc_cmos 00:02: alarms up to one month, y3k, 242 bytes nvram, hpet irqs
[ 1.954530] psmouse serio2: synaptics: Your touchpad (PNP: SYN1212 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to <email address hidden>.
[ 2.101933] psmouse serio2: synaptics: Touchpad model: 1, fw: 8.1, id: 0x1e2b1, caps: 0xd00123/0x840300/0x126800/0x0, board id: 2942, fw id: 1524475
[ 6.086528] snd_hda_codec_via hdaudioC1D0: hp_outs=1 (0x25/0x0/0x0/0x0/0x0)
$ sudo dmesg | tail -n 700 | grep -v 'wlp4s0' | grep -v iwlwifi| grep -v usb
[ 6.243805] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[ 6.296527] loop16: detected capacity change from 0 to 104536
[ 6.355070] loop17: detected capacity change from 0 to 131792
[ 11.556911] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[ 11.569556] Adding 4194300k swap on /dev/sda2. Priority:-2 extents:1 across:4194300k SSFS
[ 11.588008] audit: type=1400 audit(1618156679.669:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=815 comm="apparmor_parser"
[ 11.590199] audit: type=1400 audit(1618156679.673:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=818 comm="apparmor_parser"
[ 11.590205] audit: type=1400 audit(1618156679.673:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=818 comm="apparmor_parser"
[ 11.590208] audit: type=1400 audit(1618156679.673:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=818 comm="apparmor_parser"
[ 11.590496] audit: type=1400 audit(1618156679.673:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libvirtd" pid=819 comm="apparmor_parser"
[ 11.590501] audit: type=1400 audit(1618156679.673:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libvirtd//qemu_bridge_helper" pid=819 comm="apparmor_parser"
[ 11.592741] audit: type=1400 audit(1618156679.673:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=817 comm="apparmor_parser"
[ 11.592749] audit: type=1400 audit(1618156679.673:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=817 comm="apparmor_parser"
[ 11.594591] audit: type=1400 audit(1618156679.677:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=828 comm="apparmor_parser"
[ 12.091703] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 12.091707] Bluetooth: BNEP filters: protocol multicast
[ 12.091711] Bluetooth: BNEP socket layer initialized
[ 12.101767] NET: Registered protocol family 38
[ 12.653787] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 12.654547] virbr0: port 1(virbr0-nic) entered blocking state
[ 12.654550] virbr0: port 1(virbr0-nic) entered disabled state
[ 12.654585] device virbr0-nic entered promiscuous mode
[ 12.677683] RTL8211E Gigabit Ethernet r8169-502:00: attached PHY driver (mii_bus:phy_addr=r8169-502:00, irq=IGNORE)
[ 12.684646] bpfilter: Loaded bpfilter_umh pid 1294
[ 12.684869] Started bpfilter
[ 12.757980] loop18: detected capacity change from 0 to 8
[ 12.897333] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 14.338158] virbr0: port 1(virbr0-nic) entered blocking state
[ 14.338166] virbr0: port 1(virbr0-nic) entered listening state
[ 14.378319] virbr0: port 1(virbr0-nic) entered disabled state
[ 14.469663] L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.
[ 15.643026] r8169 0000:05:00.2 enp5s0f2: Link is Up - 1Gbps/Full - flow control rx/tx
[ 15.643059] IPv6: ADDRCONF(NETDEV_CHANGE): enp5s0f2: link becomes ready
[ 19.596738] rfkill: input handler disabled
[ 68.418033] Bluetooth: RFCOMM TTY layer initialized
[ 68.418040] Bluetooth: RFCOMM socket layer initialized
[ 68.418044] Bluetooth: RFCOMM ver 1.11
[ 68.585006] rfkill: input handler enabled
[ 71.544241] rfkill: input handler disabled
[ 71.673340] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 101.659726] PM: suspend entry (deep)
[ 101.669410] Filesystems sync: 0.009 seconds
[ 101.787043] Freezing user space processes ... (elapsed 0.003 seconds) done.
[ 101.790418] OOM killer disabled.
[ 101.790420] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 101.791762] printk: Suspending console(s) (use no_console_suspend to debug)
[ 101.809074] sd 4:0:0:0: [sda] Synchronizing SCSI cache
[ 101.810234] sd 4:0:0:0: [sda] Stopping disk
[ 103.741756] ACPI: EC: interrupt blocked
[ 103.761838] ACPI: Preparing to enter system sleep state S3
[ 103.763809] ACPI: EC: event blocked
[ 103.763811] ACPI: EC: EC stopped
[ 103.763812] PM: Saving platform NVS memory
[ 103.763834] Disabling non-boot CPUs ...
[ 103.765638] smpboot: CPU 1 is now offline
[ 103.768592] smpboot: CPU 2 is now offline
[ 103.771379] smpboot: CPU 3 is now offline
[ 103.773286] IRQ 31: no longer affine to CPU4
[ 103.774312] smpboot: CPU 4 is now offline
[ 103.776710] IRQ 34: no longer affine to CPU5
[ 103.777743] smpboot: CPU 5 is now offline
[ 103.779274] IRQ 18: no longer affine to CPU6
[ 103.779291] IRQ 36: no longer affine to CPU6
[ 103.780305] smpboot: CPU 6 is now offline
[ 103.781900] IRQ 16: no longer affine to CPU7
[ 103.781921] IRQ 38: no longer affine to CPU7
[ 103.782939] smpboot: CPU 7 is now offline
[ 103.785240] ACPI: Low-level resume complete
[ 103.785286] ACPI: EC: EC started
[ 103.785287] PM: Restoring platform NVS memory
[ 103.787989] Enabling non-boot CPUs ...
[ 103.788039] x86: Booting SMP configuration:
[ 103.788040] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 103.790260] CPU1 is up
[ 103.790292] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 103.792541] CPU2 is up
[ 103.792574] smpboot: Booting Node 0 Processor 3 APIC 0x6
[ 103.794813] CPU3 is up
[ 103.794845] smpboot: Booting Node 0 Processor 4 APIC 0x1
[ 103.795612] CPU4 is up
[ 103.795641] smpboot: Booting Node 0 Processor 5 APIC 0x3
[ 103.796285] CPU5 is up
[ 103.796308] smpboot: Booting Node 0 Processor 6 APIC 0x5
[ 103.796964] CPU6 is up
[ 103.796987] smpboot: Booting Node 0 Processor 7 APIC 0x7
[ 103.797667] CPU7 is up
[ 103.800551] ACPI: Waking up from system sleep state S3
[ 103.801881] ACPI: EC: interrupt unblocked
[ 103.823428] ACPI: EC: event unblocked
[ 103.824287] sd 4:0:0:0: [sda] Starting disk
[ 103.902508] xhci_hcd 0000:00:14.0: Port resume timed out, port 3-2: 0x400a03
[ 104.148851] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 104.177019] ata3: SATA link down (SStatus 0 SControl 300)
[ 104.177122] ata5: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[ 104.185202] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 104.185217] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 104.185219] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 104.185456] ata5.00: supports DRM functions and may not be fully accessible
[ 104.185890] ata5.00: NCQ Send/Recv Log not supported
[ 104.186818] ata5.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded
[ 104.186823] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out
[ 104.186836] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out
[ 104.187026] ata5.00: supports DRM functions and may not be fully accessible
[ 104.187455] ata5.00: NCQ Send/Recv Log not supported
[ 104.188085] ata5.00: configured for UDMA/133
[ 104.192377] ata1.00: configured for UDMA/100
[ 104.770315] OOM killer enabled.
[ 104.770317] Restarting tasks ... done.
[ 104.777024] PM: suspend exit
[ 104.960199] psmouse serio2: synaptics: queried max coordinates: x [..5672], y [..4722]
[ 105.119539] psmouse serio2: synaptics: queried min coordinates: x [1380..], y [1192..]
[ 105.343536] Bluetooth: hci0: read Intel version: 370710018002030d00
[ 105.346931] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
[ 105.548595] Bluetooth: hci0: unexpected event for opcode 0xfc2f
[ 105.565685] Bluetooth: hci0: Intel BT fw patch 0x57 completed & activated
[ 106.015277] RTL8211E Gigabit Ethernet r8169-502:00: attached PHY driver (mii_bus:phy_addr=r8169-502:00, irq=IGNORE)
[ 106.228703] r8169 0000:05:00.2 enp5s0f2: Link is Down
[ 109.015553] r8169 0000:05:00.2 enp5s0f2: Link is Up - 1Gbps/Full - flow control rx/tx
[ 109.015588] IPv6: ADDRCONF(NETDEV_CHANGE): enp5s0f2: link becomes ready
[39713.651995] kauditd_printk_skb: 41 callbacks suppressed
[39713.651998] audit: type=1400 audit(1618196422.599:53): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=51532 comm="cups-browsed" capability=23 capname="sys_nice"
[85101.726103] audit: type=1400 audit(1618241809.285:54): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/usr/share/zoneinfo-icu/44/le/zoneinfo64.res" pid=63265 comm="soffice.bin" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[85101.726135] audit: type=1400 audit(1618241809.285:55): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/usr/share/zoneinfo-icu/44/le/timezoneTypes.res" pid=63265 comm="soffice.bin" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[85147.248028] audit: type=1400 audit(1618241854.807:56): apparmor="ALLOWED" operation="connect" profile="libreoffice-oopslash" name="/tmp/OSL_PIPE_1000_SingleOfficeIPC_8d96313d95addc425834d37c9ec5b82b" pid=63301 comm="oosplash" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=1000
[85147.248036] audit: type=1400 audit(1618241854.807:57): apparmor="ALLOWED" operation="file_perm" profile="libreoffice-oopslash" name="/tmp/OSL_PIPE_1000_SingleOfficeIPC_8d96313d95addc425834d37c9ec5b82b" pid=63301 comm="oosplash" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[85147.248040] audit: type=1400 audit(1618241854.807:58): apparmor="ALLOWED" operation="file_perm" profile="libreoffice-oopslash" name="/tmp/OSL_PIPE_1000_SingleOfficeIPC_8d96313d95addc425834d37c9ec5b82b" pid=63301 comm="oosplash" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[85147.248076] audit: type=1400 audit(1618241854.807:59): apparmor="ALLOWED" operation="file_perm" profile="libreoffice-oopslash" name="/tmp/OSL_PIPE_1000_SingleOfficeIPC_8d96313d95addc425834d37c9ec5b82b" pid=63301 comm="oosplash" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
[85147.248080] audit: type=1400 audit(1618241854.807:60): apparmor="ALLOWED" operation="file_perm" profile="libreoffice-oopslash" name="/tmp/OSL_PIPE_1000_SingleOfficeIPC_8d96313d95addc425834d37c9ec5b82b" pid=63301 comm="oosplash" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
[85370.993272] audit: type=1400 audit(1618242078.544:61): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/proc/63554/mountinfo" pid=63554 comm="pool-soffice" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[85370.993668] audit: type=1400 audit(1618242078.548:62): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/run/mount/utab" pid=63554 comm="pool-soffice" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[85406.074858] audit: type=1400 audit(1618242113.627:63): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/usr/share/zoneinfo-icu/44/le/zoneinfo64.res" pid=63632 comm="soffice.bin" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[85406.074995] audit: type=1400 audit(1618242113.627:64): apparmor="ALLOWED" operation="open" profile="libreoffice-soffice" name="/usr/share/zoneinfo-icu/44/le/timezoneTypes.res" pid=63632 comm="soffice.bin" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Bump:

So, the big question is, is there something I can do to fix this or do I need to file a bug?

Manfred Hampl (m-hampl) said : #11

The only workaround I can suggest is manually extracting the missing file from the deb package and putting it where it belongs.

If you create a bug report, then you most probably should file it against "hplip in Ubuntu", because the problem seems to be only in the package for Ubuntu and not in the original HPLIP software.

OK Thanks!

How do I go about "manually extracting the missing file from the deb package and putting it where it belongs"?

I noticed that, when I enter dpkg -s hplip, the output includes the lines
...
Conffiles:
 /etc/dbus-1/system.d/com.hp.hplip.conf 3f3b1250ca68d54419d19d6ddf1b9ad4

I'm not sure what the long number is at the end but I wonder if I can just make a symbolic link to that file?

$ sudo ln /etc/dbus-1/system.d/com.hp.hplip.conf /etc/hp/hplip.conf

Does it matter if it is a symbolic or hard link?

No, unfortunately, other errors occur suggesting that "/etc/dbus-1/system.d/com.hp.hplip.conf" does not contain the expected information:

$ sudo ln /etc/dbus-1/system.d/com.hp.hplip.conf /etc/hp/hplip.conf
[sudo] password for username:
$ sh hplip-3.20.3-plugin.run
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................
Traceback (most recent call last):
  File "./plugin_install.py", line 49, in <module>
    config.read(config_file)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/hp/hplip.conf, line: 1
'<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->\n'
$

The output of dpkg -L hplip doesn't show any other files for the /etc directory. Any ideas before I give up this question and wait for any response from the bug report?

Manfred Hampl (m-hampl) said : #15

There is a "dpkg-deb --extract" command that allows extracting the files from a deb package into a directory.
This should allow unpacking the contents of the deb archive into a temporary directory and then copying the conf file to the right location. Carefully read the manpages how to use it before trying this.

@Manfred:

As I said already, the conf file listed in the output of dpkg -L hplip do not show any file named "/etc/hp/hplip.conf":

$ dpkg -L hplip
/.
/etc
/etc/dbus-1
/etc/dbus-1/system.d
/etc/dbus-1/system.d/com.hp.hplip.conf
/usr
/usr/bin
... etc

Also:
$ apt download hplip
$ dpkg-deb -c hplip_3.20.3+dfsg0-2_amd64.deb
drwxr-xr-x root/root 0 2020-04-01 03:51 ./
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/dbus-1/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./etc/dbus-1/system.d/
-rw-r--r-- root/root 752 2020-04-01 03:51 ./etc/dbus-1/system.d/com.hp.hplip.conf
drwxr-xr-x root/root 0 2020-04-01 03:51 ./usr/
drwxr-xr-x root/root 0 2020-04-01 03:51 ./usr/bin/
... etc

$ dpkg-deb --extract hplip_3.20.3+dfsg0-2_amd64.deb hplip_3.20.3+dfsg0-2_amd64
$ tree hplip_3.20.3+dfsg0-2_amd64/etc
hplip_3.20.3+dfsg0-2_amd64/etc
└── dbus-1
    └── system.d
        └── com.hp.hplip.conf

2 directories, 1 file
$

So, which file in this list am I supposed to copy to /etc/hp/hplip.conf?

$ sudo cp hplip_3.20.3+dfsg0-2_amd64/etc/dbus-1/system.d/com.hp.hplip.conf /etc/hp/hplip.conf
[sudo] password for username:

$ sh hplip-3.20.3-plugin.run
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................
Traceback (most recent call last):
  File "./plugin_install.py", line 49, in <module>
    config.read(config_file)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/hp/hplip.conf, line: 1
'<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->\n'

Same error as I got in comment #14!

I am making the incorrect assumption that /etc/dbus-1/system.d/com.hp.hplip.conf
is the same as /etc/hp/hplip.conf, which clearly is incorrect.

There is no /etc/hp/hplip.conf in the package at all!

Best Manfred Hampl (m-hampl) said : #17

Sorry, my fault, I was not clear enough.

From comment #5:
$ dpkg -L libsane-hpaio | grep conf
/etc/hp/hplip.conf

The file /etc/hp/hplip.conf is in the package libsane-hpaio, i.e. in libsane-hpaio_3.20.3+dfsg0-2_amd64.deb

$ sudo cp libsane-hpaio_3.20.3+dfsg0-2_amd64/etc/hp/hplip.conf /etc/hp$ sh hplip-3.20.3-plugin.run
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................
Error importing HPLIP modules. Is HPLIP installed?
$

So, now what? Let's dig in! It turns out there's a help option:

$ sh hplip-3.20.3-plugin.run --help
Makeself version 2.1.5
 1) Getting help or info about hplip-3.20.3-plugin.run :
  hplip-3.20.3-plugin.run --help Print this message
  hplip-3.20.3-plugin.run --info Print embedded info : title, default target directory, embedded script ...
  hplip-3.20.3-plugin.run --lsm Print embedded lsm entry (or no LSM)
  hplip-3.20.3-plugin.run --list Print the list of files in the archive
  hplip-3.20.3-plugin.run --check Checks integrity of the archive

 2) Running hplip-3.20.3-plugin.run :
  hplip-3.20.3-plugin.run [options] [--] [additional arguments to embedded script]
  with following options (in that order)
  --confirm Ask before running embedded script
  --noexec Do not run embedded script
  --keep Do not erase target directory after running
   the embedded script
  --nox11 Do not spawn an xterm
  --nochown Do not give the extracted files to the current user
  --target NewDirectory Extract in NewDirectory
  --tar arg1 [arg2 ...] Access the contents of the archive through the tar command
  -- Following arguments will be passed to the embedded script

It looks like I can extract the plugin and see what can be done there:

$ sh hplip-3.20.3-plugin.run --noexec --target testplugin
$ cd testplugin
$ ./hplip-plugin-install
Error importing HPLIP modules. Is HPLIP installed?
$ cd ..
$

So it seems that the bash script invokes plugin_install.py
The script is failing with an exception in a try block that is importing several
modules but which one is it? I broke up the try block into a number of blocks,
one for each import operation:

$ diff plugin-orig/plugin_install.py testplugin/plugin_install.py
21a22
> print ("Running ", __file__)
95a97,103
> #try:
> # from base.g import *
> # from base.codes import *
> # from base import utils, tui, module
> #except ImportError:
> # print("Error importing HPLIP modules. Is HPLIP installed?")
> # sys.exit(1)
98a107,111
> except ImportError:
> print("Error importing base.g")
> sys.exit(1)
>
> try:
100d112
< from base import utils, tui, module
102c114,133
< print("Error importing HPLIP modules. Is HPLIP installed?")
---
> print("Error importing base.codes")
> sys.exit(1)
>
> try:
> from base import utils
> except ImportError:
> print("Error importing utils")
> sys.exit(1)
>
> try:
> from base import tui
> except ImportError:
> print("Error importing tui")
> sys.exit(1)
>
> try:
> from base import module
> except ImportError as error:
> print("Error importing module")
> print(error.__class__.__name__ + ": " + error.message)
$ cd testplugin/
$ ./hplip-plugin-install
('Running ', './plugin_install.py')
Error importing module
ImportError: No module named cupsext
$

So what is "cupsext"?

After googling the error, I came across this web page:

https://developers.hp.com/hp-linux-imaging-and-printing/KnowledgeBase/Troubleshooting/TroubleshootErrors

which states:

ImportError:No Module named 'cupsext'
Notes:
Extension modules are missing from the current Python path "/usr/lib/python<version>/dist-packages".
This happens when HPLIP is installed using one python version and you are running HPLIP using another python version.
For example, HPLIP was installed using python2.x and running the tools using python3.x

Please ensure to run HPLIP tools using the same version of Python which was used for HPLIP installation or re-install HPLIP from https://developers.hp.com/hp-linux-imaging-and-printing/gethplip

My question is this: What do they mean by "HPLIP was installed using python2.x and running the tools using python3.x"?

How was I supposed to know this in advance?

$ python -V
Python 2.7.18
$

So how do I find out which python is supposed to be running? How do I make the correct version of python run?
How do I install hplip with the correct version of python? Ditto for the plugin.

$ apt-cache depends hplip | grep python
  Depends: python3-dbus
  Depends: python3-gi
  Depends: python3-pexpect
  Depends: python3-pil
  Depends: python3-reportlab
  Depends: <python3:any>
    python3:i386
    python3
  Depends: python3
  Depends: python3
  Depends: libpython3.8
  Suggests: python3-notify2

$ dpkg -s python3
Package: python3
Status: install ok installed
Priority: important
Section: python
Installed-Size: 189
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Multi-Arch: allowed
Source: python3-defaults
Version: 3.8.2-0ubuntu2
Replaces: python3-minimal (<< 3.1.2-2)
Provides: python3-profiler
Depends: python3.8 (>= 3.8.2-1~), libpython3-stdlib (= 3.8.2-0ubuntu2)
Pre-Depends: python3-minimal (= 3.8.2-0ubuntu2)
Suggests: python3-doc (>= 3.8.2-0ubuntu2), python3-tk (>= 3.8.2-1~), python3-venv (>= 3.8.2-0ubuntu2)
Description: interactive high-level object-oriented language (default python3 version)
 Python, the high-level, interactive object oriented language,
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.
 .
 This package is a dependency package, which depends on Debian's default
 Python 3 version (currently v3.8).
Homepage: https://www.python.org/
Original-Maintainer: Matthias Klose <email address hidden>
$

$ ls /usr/lib/python3/dist-packages | grep cupsext
cupsext.cpython-38-x86_64-linux-gnu.so

Can I do something like this?
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

If I do this do I have to re-install hplip?

Let's see:
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
[sudo] password for username:
update-alternatives: using /usr/bin/python3 to provide /usr/bin/python (python) in auto mode
$ sh hplip-3.20.3-plugin.run
Verifying archive integrity... All good.
Uncompressing HPLIP 3.20.3 Plugin Self Extracting Archive..............................................................

HP Linux Imaging and Printing System (ver. 3.20.3)
Plugin Installer ver. 3.0

Copyright (c) 2001-18 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.

Plug-in version: 3.20.3
Installed HPLIP version: 3.20.3
Number of files to install: 64

note: Using PyQt5

Done.
$

THAT'S IT!!!

I just printed a test page and a libre-office document!

Thanks Manfred Hampl, that solved my question.

Manfred Hampl (m-hampl) said : #23

Congratulations for solving the puzzle!