Ubuntu – How to fix missing libudev.so.0 for Chrome to start again


Trying to start chrome yields in following error on the command line:

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

The error first appeared in Ubuntu 13.04, I tried purging and reinstalling Chrome. It persisted after upgrading to Ubuntu 13.10.

Best Answer

If Chrome doesn't start after an Ubuntu upgrade from ≤12.10 to ≥13.04, open a terminal and run the following command:

sudo dpkg-reconfigure google-chrome-stable

Explanations follow.

At least for Chrome versions form 28 to 37, the Chrome binary can use whichever of libudev.so.0 or libudev.so.1 is present on the system. With the fix to Chromium/Chrome Issue 226002 (which went into the unstable channel in April 2013), the installer determines which one to use. The binary references libudev.so.0; the installer creates a symbolic link from /opt/google/chrome/libudev.so.0 to the libudev.so.1 on the system if libudev.so.0 is not found.

Note that it would be a bad idea to create one in /usr/lib. Major version numbers in libraries change when the newer version is incompatible. Creating this symbolic link works well for Chrome because it only uses features that are compatible between version 0 and version 1. Other applications might crash or produce corrupt data if you force them to run with the wrong version.

The method used by the Chrome package works well under most circumstances, but it's still a dirty hack, and it has a limitation. If the libudev0 package is uninstalled after Chrome is installed, which is likely to happen when you upgrade Ubuntu, then Chrome will still be set up to use libudev.so.0 but the file won't be available anymore. To fix this, cause the installation script to run again, and this time detect that libudev.so.0 is not available so it should create the symbolic link to use libudev.so.1 instead. You can re-run the installation script by running dpkg-reconfigure google-chrome-stable as root.