Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the beginning I tried to fix the problem of /lib/ld-linux-so.3:No such file or directory when I tried to run some dynamically cross-compiled binaries. So I added some shared binaries to /lib. I changed or deleted some important files in /lib. I know it seems silly.

Now the problem is whenever I want to run an executable binary I get this error:

Error while loading shared libraries:libgcc-s.so.1:cannot open shared object file: No such file or directory.

I have copied libgcc-s.so.1 to /lib from somewhere else. Would anyone give some suggestion to fix /lib? Something to update or install it again? Thanks.

share|improve this question

Try booting ubuntu from external media (CD,USB), then mount your root partition in /mnt/root for example. After that try reinstalling the libgcc1 package, the command should be something like:

apt-get --root-directory=/mnt/root install libgcc1

This should fix the libgcc problem, but perhaps you will have other problems with other libraries. Repeat this until you have usable apt-get in your real linux, where you can reinstall the other broken libs.

Hint: if you have your linux working or have another ubuntu linux, you may find the package name for each file you need by running:

apt-file search /lib/libgcc_s.so.1

Hint2: You may find useful the chroot, once you reinstall the missing libraries, you can

chroot /mnt/root /bin/sh

this way you will be able to see if your linux is working correctly without rebooting to your linux and back to external media in case it's not working.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .