How do I resolve a "Cannot open shared object file libudev.so.0" error?

262,244

Solution 1

For 64-bit Ubuntu, it is in the 32-bit libudev0 package.

You can install that with the following command:

sudo apt-get install libudev0:i386

This package was removed from Ubuntu in 14.04. You will need to install it from an older version.

Solution 2

To fix, I linked libudev.so.1 to libudev.so.0:

sudo ln -sf /lib/$(arch)-linux-gnu/libudev.so.1 /lib/$(arch)-linux-gnu/libudev.so.0

Solution 3

For ubuntu 14.04 and above

The easiest method I found was to just download the .deb (direct link to 64-bit download and to 32-bit download) and double click it to install it or use dpkg to install it:

dpkg -i libudev0_175-0ubuntu9_amd64.deb

For previous versions

In previous version of ubuntu this package was available in the official repositories. You can install with the following:

sudo apt-get install libudev0:i386

Solution 4

I had the same problem for a different program, but Sean's accepted answer didn't help me at all. On my upgraded install of 64-bit 13.04, libudev0 is not available either in 64-bit form or i386 form. And ia32-libs is already installed. So no dice.

What I had to do was a slightly modified version senshikaze's more technical solution. I manually symlinked libudev.so.0 to libudev.so.1 in the x86_64 lib directory, thusly:

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

This fixed it for me.

Solution 5

This error might happen when trying to use nw executable from Node Webkit. Like this:

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

How to solve:

  1. Get hex editor that allows you to change ASCII string of binary, eg. hexedit:

    • In terminal(Ctrl+Alt+T), run: sudo apt-get install hexedit.
    • Follow instructions presented in terminal(type password if needed, confirm install).
  2. Go to directory with node webkit:
    • In my case: cd ~/Dokumenty/node-webkit-*.
  3. Open nw binary using hex editor command preceded with sudo:
    • Run: sudo hexedit nw.
  4. Search for libudev.so.0 as ASCII string:
    • If using hexedit: Press Tab.
    • Press Ctrl+S.
    • Type: libudev.so.0.
  5. Change 0 in libudev.so.0 string to 1, so it becomes: libudev.so.1:
    • Use arrow keys to select 0 in libudev.so.0 string.
    • Press 1 on keyboard.
  6. Exit and save changes.
    • Press Ctrl+X.
    • Press Y to save changes.

You're done. This also fixes problem with Atraci binary when following same instructions except hex editing Atraci file instead of nw.

Share:
262,244

Related videos on Youtube

Christian Smith
Author by

Christian Smith

Updated on September 18, 2022

Comments

  • Christian Smith
    Christian Smith over 1 year

    Trying to run Game Dev Tycoon on Ubuntu 64. It asks for the above object.

    I ran sudo apt-get install libudev1:i386 and it came back already installed.

    I have /lib/i386-linux-gnu/libudev.so.1 but no libudev.so.0 anywhere.

    • igorsantos07
      igorsantos07 over 8 years
      This happened when trying to install the new version of Popcorntime on Mint Petra 16
  • Stefano
    Stefano over 10 years
    for 64 bit: sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
  • user214274
    user214274 over 10 years
    cd /lib/x86_64-linux-gnu/ sudo cp libudev.so.0.13.0 libudev.so.1
  • dobey
    dobey over 10 years
    Please do not do this. It is only asking for problems.
  • Johan Bjäreholt
    Johan Bjäreholt about 10 years
    This messed up Plex Home Theatre for me, to revert remove libudev.so.0 symlink and reinstall libudev0:i386
  • John Frost
    John Frost almost 10 years
    no package found when trying to looking for libudev0:i386 any ideas ?
  • Phil Strong
    Phil Strong almost 10 years
    I ended up doing sudo apt-get install libudev1:i386 and then sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
  • amit_saxena
    amit_saxena over 9 years
    On 32 bit this is the command (in case someone reached here): sudo ln -sf /lib/i386-linux-gnu/libudev.so.1 /lib/i386-linux-gnu/libudev.so.0
  • That Brazilian Guy
    That Brazilian Guy over 9 years
    This command isn't working for me: on Precise 32 bits, the files are on /lib/i386, but $(arch) is i686. And I have libudev0 but not libudev1, so I had to link the other way round.
  • Catalyst
    Catalyst over 9 years
    cat nw | sed s/libudev.so.0/libudev.so.1/ > fixed_nw, chmod a+x fixed_nw and then you can run it, no need to install anything
  • berbt
    berbt about 9 years
    THIS IS THE RIGHT ANSWER. If a package is missing, you install the package... is that simple. Creating links, hex-editing names, reconfiguring Google Chrome, hammering the CPU and snorting chilli powder are not real solutions.
  • berbt
    berbt about 9 years
    Listen to dobey, this is a messy procedure. Ryan Crichton posted the right way to do it HERE.
  • Flimm
    Flimm about 9 years
    I like this idea, although I wonder if there is a way to use LD_LIBRARY environment variable instead.
  • TenLeftFingers
    TenLeftFingers about 9 years
    @Flimm, let me know how you get on.
  • Flimm
    Flimm about 9 years
    I ended up going with this answer instead.
  • HoboBen
    HoboBen over 8 years
    I had to enter this command to get google-webdesigner to install on Debian 64 bit
  • Asela Sampath
    Asela Sampath over 8 years
    This fixed it for me too - running Ubuntu 15.04 64 bit. Thanks a bunch.
  • Asela Sampath
    Asela Sampath over 8 years
    But it only works if that package is available.
  • rubo77
    rubo77 over 8 years
    The old versions are available here: packages.ubuntu.com/precise/libudev0
  • rubo77
    rubo77 over 8 years
    Please install the old version from here: packages.ubuntu.com/precise/libudev0
  • lord-ralf-adolf
    lord-ralf-adolf over 8 years
    This should be the right answer ! this is the proper fix ,no messy symlinks or whatsoever
  • denny
    denny over 8 years
    This is the easiest method that I can find. Adding older dependency to repository is a pain
  • Spl2nky
    Spl2nky over 8 years
    Thanks it is working in my Ubuntu 14.04 :) (Popcorn Time Issue)
  • Nikos Grigoriadis
    Nikos Grigoriadis almost 8 years
    Worked like a charm, and this is the way to go. No links, no hassle. Thanks!
  • Aaron Franke
    Aaron Franke over 7 years
    Package libudev0 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
  • aggsol
    aggsol over 7 years
    This works for STEAM!
  • Adrians Netlis
    Adrians Netlis about 7 years
    This breaks your system. For me it is not just unity not working, but wlan broke too... :(
  • Raj
    Raj over 5 years
    The solution from @PhilStrong worked for me 100%
  • Alexander Haroldo da Rocha
    Alexander Haroldo da Rocha almost 5 years
    Fixed on Ubuntu 19.04
  • kissu
    kissu almost 3 years
    Since the URL will pretty much often 404 as distro versions will increase, here is the non-specific link to it: packages.ubuntu.com/…