简体   繁体   中英

Running 32 bit exe on Ubuntu :libudev.so : cannot open shared object file: No such file or directory

I am trying to run an exe which uses libudev.so but it gives this error :

error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

Running uname -a gives :

3.5.0-44-generic #67~precise1-Ubuntu SMP Wed Nov 13 16:16:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I am using Ubuntu 12.04

I have checked /lib /lib32 /lib64 there is no libudev in there but in Synaptic manager I can see libudev0 installed (see image below)

关于Synaptic Manager的libudev and I could find it in /lib/x86_64-linux-gnu/libudev.so.0 .

What could be wrong?

It turns out (as I suspected) that you tried to run a 32-bit executable on a 64-bit system. 64-bit Linux kernel is capable of running 32-bit executables (that's why you don't get "exec format error"), but it needs a separate set of (32-bit) libraries: 64-bit version of libudev.so.0 is useless for a 32-bit program. (See ld.so manpage for some details on shared library dependency resolution).

Modern Debian-based distributions support simultaneous library installation for several architectures. apt-get install libudev0:i386 should get a 32-bit version of the library and all its dependencies (there might be plenty of them if it's the first time you use a 32-bit application). If you upgraded from an ancient installation, you might need to add i386 to architectures supported by dpkg , like this:

dpkg --add-architecture i386

Some advices to use if the program needs some other libraries as well:

  • Use ldd to see all the dependencies at once (and what's missing)
  • Install apt-file and run apt-file update , so you can look up a package name by a file name, even if the package is not currently installed (like this: apt-file search /libudev.so.0 )

There was also an old Debian way of getting 32-bit libraries on a 64-bit system: ia32-libs package in amd64 repositories provided a set of libraries, conceptually "everything your application might need". Don't use this approach unless you're running Debian squeeze or earlier (or a debian-based distro of the same age). Even when it worked, there was no guarantee that the program doesn't need some other library as well. Ia32-libs was useful when multiarch support was not ready yet, and that was some years ago.

I just followed this instructions and it works just fine.

https://askubuntu.com/questions/369310/how-to-fix-missing-libudev-so-0-for-chrome-to-start-again

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.1.3.5 /usr/lib/libudev.so.0

尝试创建符号链接:

sudo ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0

I encountered this error while messing around with Orange Pi RK3399 trying to flash firmware from Linux Mint. The solution was in manual for this Pi and given the following command:

sudo apt-get install git-core gitk git-gui gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler gcc-aarch64-linux-gnu mtools parted libudev-dev libusb-1.0-0-dev libssl-dev pv e2fsprogs build-essential fakeroot devscripts

Not sure but libudev-dev should be enough so the command would be:

sudo apt-get install libudev-dev

Not all those given packages are needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM