a computer scientist’s thoughts
RSS icon Email icon Home icon
  • How to fix your firefox (and other software) library not found error in Ubuntu

    Posted on July 3rd, 2009 Eric No comments

    I recently crashed my Firefox for no reason. I guess I accidentally removed the ia32-libs. However, when you install Firefox using apt-get, ia32-libs is not listed as the dependency. Therefore, no matter how hard you try, if you don’t have lib-ia32, you can’t use firefox, even though

     apt-get install firefox

    works fine.

    Anyway, here are some generic methods I’ve used to fix the “library not found” problem in using firefox and other pieces of software. In short, you have to use two family of tools.

    First step: Find the missing library file using ldd, objdump and nm

    The first family of tools is related you the dynamic linked library, it includes ldd, objdump and nm.

    Objdump and nm are from gnu binutls and ldd is from gnu libc. Usually, when your software complains about not finding a symbol or a missing library, you can generally use ldd to see the libraries required by your software. For instance, if your software executable file is called aaa and it is dynamically linked against some missing libraries, you can just use

    ldd aaa

    to see what are the libraries used by your software. You can use grep to filter the information you want.

    If there is a “.so hell” problem (you can find the library find you can’t find the symbol), you have to use objdump to see where is the missing symbol. Usually, you can google the missing symbol to decide the library that contains it. Anyhow, you have to first locate the library. “nm” servers a similar function. Read the man file and you will know how to use those three tools.

    Second step: locate the library file

    The second family of tools helps you to locate and get the library. They are apt-file. apt-get, gcc and Google.

    There are several possibilities for a library missing. The first is that you accidentally removed that. For this, the only problem is to find the package name that contains the missing library file. To do this, on Ubuntu, we can use a tool called apt-file. It searches all the packages in the apt repository and output all packages that contains the file name you entered. For install, if you want to find libxyz.so, you can just use

    apt-file search libxyz.so

    and it will output the package names that contains libxyz.so. There might be multiple packages, and usually it’s easy to try and decide which one is missing as if you’ve already had it on your machine, apt-get will tell you.

    Usually, you can fix your problem by installing the missing packages. But sometimes you have all latest package installed, and your software still complains about the undefined symbol. This is possible because your software may rely on an older version of the library and in the new version, some symbols get removed. For open source software, try to decide the version of the library file first, and then download the source code and compile it. Recently I crashed my gnome window manager, and it requires an older version of libxcb. I have to download the older version to let it work.If it is not the open source component, try to get a copy of the library file. Usually I will use google to find that file. Google is very good at finding files you need.

    That’s it.

    Leave a reply