'mount: error while loading shared libraries: libudev.so.0 : no such file or directory' error while booting

99

I see that some of the solutions posted on the other question overwrite libudev.so.0, because of the -f option supplied to ln. This is not due to malicious intent, but because these solutions were designed for newer versions of Ubuntu, in which the libudev1 package is used. The solution creates libudev.so.0 symbolic link. But in 12.04, libudev0 is used. So the libudev.so.0 library file is overwritten with a broken symbolic link to libudev.so.1 which doesn't exist. The solutions should not have included the -f option for ln in the command line, which overwrites files.

Enough of the explanation, here is a solution:

Basically the library file is replaced with a broken symbolic link. Start in recovery mode and select the root shell option. Then run this command: apt-get install libudev0. Once you are done, type exit and reboot. If you are using WiFi, download the libudev0 package and copy it into a USB drive. Then in the root shell in recovery, plug the USB drive and run: (tip: you can use Tab to autocomplete many things, including file paths )

sudo mount -o remount, rw / # (re)mount the filesystem in read-write mode.
mkdir /media/usb
mount /dev/sdb1 /media/usb
dpkg -i /media/usb/path_to_package_file

Then reboot and hopefully your system should work.

Share:
99
raklos
Author by

raklos

Updated on September 18, 2022

Comments

  • raklos
    raklos almost 2 years

    Im trying to execute some jquery before a form is submitted.

    The aim is to obtain user location, and save the coordinates before the form gets posted.

    but it happens too quickly and doesn't seem like it is being fully executed. the popup for sharing location shows for a split second the the form posts before i can answer yes to sharing location

    $("#DepotSearchForm").submit(function () {
    
    
            // your code here
    
                if (navigator.geolocation) {
                    navigator.geolocation.getCurrentPosition(function (position) {
                        var pos = {
                            lat: position.coords.latitude,
                            lng: position.coords.longitude
                        };
                        $('#Latitude').val(position.coords.latitude);
                        $('#Longitude').val(position.coords.longitude);
                        alert(position.coords.latitude + ", " + position.coords.longitude);
                        //gmap.setCenter(pos);
                    }, function () {
                        //alert("Unable to determine location");
                        //return false;
                    });
                } 
    
        //  }
    });
    
    • Braiam
      Braiam over 10 years
      I think that a reinstallation would be easier.
    • user199551
      user199551 over 10 years
      Braiam - thanks for the comment , in this case not for me - before the helpful answer was deleted - I checked and libudev0_175-0ubuntu9_amd64.deb is only 26 or so k large - as i have said (and did say before it was deleted) I only have wireless at the moment and I have both upgraded this system and added the drivers - so much easier for me to try to fix the broken link.
    • Admin
      Admin about 10 years
      I had a similar problem trying to install LightTable on 12.04. This solution fixed my boot problem but I did have to run:- sudo mount -o remount,rw / because dpkg was giving lock file errors. Given up installing LightTable!
  • user3303605
    user3303605 about 10 years
    what if the file system is read-only?
  • Ramchandra Apte
    Ramchandra Apte about 10 years
    @kapitanluffy Correct, I will update the solution.
  • Gino Mempin
    Gino Mempin over 4 years
    On my machine, apt-get install libudev0 did not work, because libudev.so.0 already existed but it was symlinked to an invalid file (it throws the same error message). Simply fixing the symlink worked, example: cd /lib/x86_64-linux-gnu; ln -sf libudev.so.1.6.9 libudev.so.0 (make sure the correct libudev.so.x.x.x actually exists in that directory).