3

I'm trying to install a CAN emulator software with GTK and I keep getting an error.

CANMate: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory

But when apt says libgtk-3 is installed:

$ sudo apt install libgtk-3-0 libgtk-3-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgtk-3-0 is already the newest version (3.22.30-1ubuntu1).
libgtk-3-dev is already the newest version (3.22.30-1ubuntu1).

And the shared lib can be found inside /usr/lib/x86_64-linux-gnu.

$ ls | grep libgtk-3
libgtk-3-0
libgtk-3.so
libgtk-3.so.0
libgtk-3.so.0.2200.30

I think the installation file CANMatev1.3.deb is failing to locate the shared lib while installation.

Can you please, help me resolve this error?

ThunderBird
  • 1,963
  • 13
  • 22
  • 31

1 Answers1

5

On a hunch, let's see if the problem is that the application is 32-bit

  • unpack the deb to a local directory

    $ mkdir ./tmproot
    $ dpkg -x CANMAte_V1.3_Linux/deb/CANMatev1.3.deb ./tmproot
    
  • examine the application binary

    $ file ./tmproot/usr/bin/CANMate 
    ./tmproot/usr/bin/CANMate: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=061c53b0a1b07aca998506681c2a93039181979e, not stripped
    

So, since you are using a 64-bit OS, you will need to enable multiarch and install the 32-bit version of any required libraries

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libgtk-3-0:i386

See also How to run 32-bit app in Ubuntu 64-bit?

steeldriver
  • 142,475