7

I ran sudo mv /lib/x86_64-linux-gnu/libpthread.so.0 ~, which in retrospect, was not the world's greatest idea.

Now, I can't do anything. Any commands I run fail with error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory.

I can't run apt, I can't even do an ls. I can't move the file back with [sudo] mv ~/libpthread.so.0 /lib/x86_64-linux-gnu/. I can't run ldconfig. Any ideas on how to undo this damage?

One possible relevant fact is that /lib/x86_64-linux-gnu/ also contained the file libpthread-2.27.so, which was perhaps symlinked with libpthread.so.0 somehow?

I don't think it matters, but this is Ubuntu 18.04 running on WSL.

  • I can cd without error! – crockeea Apr 1 at 20:53
  • What happens if you type LD_LIBRARY_PATH=$HOME ls? – steeldriver Apr 1 at 20:55
  • @steeldriver Same error :( – crockeea Apr 1 at 20:59
  • Try sudo /sbin/ldconfig -v. Check man ldconfig for info. – Raffa Apr 1 at 22:38
  • I couldn't use sudo at all. – crockeea Apr 1 at 22:52
10

Fortunately, I was able to fix my problem.

I wasn't able to use sudo, since it resulted in the error above. However, I was able to follow the directions here to make the terminal start as root. At that point, I was able to make a new symlink ln -s /lib/x86_64-linux-gnu/libpthread-2.27.so /lib/x86_64-linux-gnu/libpthread.so.0.

I reset the user back to my personal account, and the problem was fixed.

| improve this answer | |

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.