Ubuntu – Error installing xsane, sane, hplip, etc with undefined symbol: libusb_set_option error

hpscanner

I consistantly get this error;

xsane: symbol lookup error: /usr/lib/x86_64-linux-gnu/libsane.so.1: undefined symbol: libusb_set_option

and this error;

checking for sane_open in -lsane... no
configure: error: cannot find sane-backends-devel support (or --disable-scan-build)" 
when trying to install hplip-3.20.5

I have had this problem since Ubuntu 19, I am currently using Ubuntu 20.04. I have reinstalled libusb-1, libsane.so.1

I am trying to install an HP multifunction printer 'HP Office jet pro 9018'

Starting off, here is the tl;dr —

apt-cache policy xsane libsane1 libsane-common libusb-1.0
xsane:
  Installed: 0.999-8ubuntu2
  Candidate: 0.999-8ubuntu2
  Version table:
 *** 0.999-8ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status
libsane1:
  Installed: 1.0.30+git20200801-focal0
  Candidate: 1.0.30+git20200802-focal0
  Version table:
     1.0.30+git20200802-focal0 500
        500 http://ppa.launchpad.net/rolfbensch/sane-git/ubuntu focal/main amd64 Packages
 *** 1.0.30+git20200801-focal0 100
        100 /var/lib/dpkg/status
     1.0.29-0ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
libsane-common:
  Installed: 1.0.30+git20200801-focal0
  Candidate: 1.0.30+git20200802-focal0
  Version table:
     1.0.30+git20200802-focal0 500
        500 http://ppa.launchpad.net/rolfbensch/sane-git/ubuntu focal/main amd64 Packages
        500 http://ppa.launchpad.net/rolfbensch/sane-git/ubuntu focal/main i386 Packages
 *** 1.0.30+git20200801-focal0 100
        100 /var/lib/dpkg/status
     1.0.29-0ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
libusb-1.0-0:
  Installed: 2:1.0.23-2build1
  Candidate: 2:1.0.23-2build1
  Version table:
 *** 2:1.0.23-2build1 500
        500 htt_://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
libusb-1.0-0-dev:
  Installed: 2:1.0.23-2build1
  Candidate: 2:1.0.23-2build1
  Version table:
 *** 2:1.0.23-2build1 500
        500 htt_://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
libusb-1.0-doc:
  Installed: 2:1.0.23-2build1
  Candidate: 2:1.0.23-2build1
  Version table:
 *** 2:1.0.23-2build1 500
        500 htt_://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 htt_://archive.ubuntu.com/ubuntu focal/main i386 Packages
        100 /var/lib/dpkg/status

Thanks – Did all that now the error is;


$ hp-setup 192.168.10.10
error: Unable to locate models.dat file

HP Linux Imaging and Printing System (ver. 0.0.0)
Printer/Fax Setup Utility ver. 9.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.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)

Traceback (most recent call last):
  File "/usr/share/hplip/base/models.py", line 558, in __getitem__
    return self.__cache[model]
KeyError: 'hp_officejet_pro_9010_series'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 358, in <module>
    device_uri, sane_uri, fax_uri = device.makeURI(param, jd_port)
  File "/usr/share/hplip/base/device.py", line 416, in makeURI
    mq = queryModelByURI(cups_uri)
  File "/usr/share/hplip/base/device.py", line 457, in queryModelByURI
    return queryModelByModel(model)
  File "/usr/share/hplip/base/device.py", line 446, in queryModelByModel
    return model_dat[model]
  File "/usr/share/hplip/base/models.py", line 564, in __getitem__
    if self.read_section(self.released_dat, model):
  File "/usr/share/hplip/base/models.py", line 474, in read_section
    fd = open(filename)

the models.dat file looks like this;

$ ls -al /usr/share/hplip/models/
total 8
drwxr-xr-x  2 root root 4096 Aug 15 07:08 .
drwxr-xr-x 13 root root 4096 Aug 15 07:08 ..
lrwxrwxrwx  1 root root   39 Aug 15 07:08 models.dat -> /usr/share/hplip/data/models/models.dat

And I get this when trying to run xsane;

xsane: symbol lookup error: /usr/lib/x86_64-linux-gnu/libsane.so.1: undefined symbol: libusb_set_option

Best Answer

  • It looks like you have messed the stuff by using PPA. Remove it with:

    sudo apt-get install ppa-purge
    sudo ppa-purge ppa:rolfbensch/sane-git
    

    and then reinstall sane from the official repository by:

    sudo apt-get install --reinstall libsane1=1.0.29-0ubuntu5 libsane-common=1.0.29-0ubuntu5
    

    About HPLIP please consider to install it from repository by running:

    sudo apt-get install hplip-gui
    

    followed by hp-setup and

    hp-plugin
    

    as you may need it to support scanner of your device.

  • Related Question