I had just compiled and installed libc locally into my home directory. Sadly, after this, virtually every basic utility like ls and xz failed to function.

The error message prompted up when executing ls:
ls: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument

After doing some research on Google, it appeared to me that I have to recompile and relink these basic tools to solve the problem, which seems a bit too tricky. Therefore, I decided to simply removed the libc library just installed.

How do I remove the locally install version of libc from ~/lib and ~/include? I had already installed numerous libraries into ~/lib before installing libc, which added another tons of files. As a result, it's all mixed up now.

I think I could probably solve this by conditionally removing the files based on the last modified time. Is there any cleaner solution?

  • To me it sounds like you didn't only install files to your home directory. Why would /bin/ls and other tools look for libraries there? – user13742 May 22 '13 at 9:35
  • Often makefiles not only have an install, but also an uninstall target. You could try to run make uninstall. Another option is to install it into a known clean directory, e.g. ~/somewhere and delete those installed files from the first installation. – Marco May 22 '13 at 9:39
  • @htor I guess it's because I had set LD_LIBRARY_PATH in .profile to ~/lib. – chenaren May 22 '13 at 9:39
  • @chenaren Does the problem still occur if you remove the local paths from LD_LIBRAY_PATH? You shouldn't mix different version of libraries. – user13742 May 22 '13 at 9:42
  • @htor I actually did that. Now my task is to remove the libc files from it, so that I can use other libraries installed in it. – chenaren May 22 '13 at 9:45

I deleted the unwanted library files with:

find -mtime -1 -maxdepth 1 -exec rm -rf {} \;

which finds the files and directories modified within one day under the current directory, and removes all of them.


What you need to do depends on where the newly installed files were installed and possible on your distro. If you have had configured to install them in /usr/local/lib you can remove them and ls will find the originals under /usr/lib again.

If you have overwritten the location where things are normally installed your installer might not work any more, you would have to try reinstalling libc6 e.g. under Ubuntu:

sudo apt-get install --reinstall libc6
  • Sorry, I forgot to mention. I don't have the root privilege on this machine. It's the reason why I installed it into my home directory. – chenaren May 22 '13 at 9:35
  • 1
    Well in that case you are unlikely to have overwritten the system installed libc. You should be able to remove the libc6.so file and if that does not work (rm complaining like ls see if you can change the library search path (LD_LIBRARY_PATH=) so it will not search in your home directory anymore. Did you install the library or did you 'just' do an ls in the directory you have build the libc library? – Anthon May 22 '13 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.