Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was having a problem where my libiconv.2.dylib file in /usr/lib was corrupt and lots of applications were failing. I got a copy of a friends /usr/lib folder and was going to swap them out. Apparently I didn't think it through well enough because when I issued sudo mv /usr/lib /usr/lib.old all hell broke loose. Now Finder won't open, Terminal.app just keeps saying "Illegal Operation" and other stuff like Archive Utility doesn't work. I'm pretty sure that if I reboot my machine it won't start up at all.

How can I rename this back, or rename my friends copy to just /usr/lib (currenty /usr/lib.new)???

share|improve this question
    
I don't have my install DVD either as I just moved and can't find where I packed it! –  Chrisbloom7 Jul 27 '10 at 5:27

4 Answers 4

up vote 4 down vote accepted

Thanks for the suggestions. I panicked early this morning and dug through every box until I found the OS X DVD. I was able to boot from the DVD directly and then use the DVD's terminal instance to rename the usr/lib/ folder back. I also reinstalled OS X and Xcode developer tools just in case. It boots up fine now, and no more errors about libiconv either.

share|improve this answer
1  
well good on ya for solving your own problem :P –  Robert S Ciaccio Jul 28 '10 at 1:42
1  
Just to add to this answer: you should see your Mac's drives in the /Volumes folder. So cd /Volumes/Whatever before you do your mv. –  Dominic Sayers Jul 4 '11 at 10:28

Your programs stopped working because they probably were linked against libraries (a hard dependency) which couldn't be found anymore. This stopped the programs from working.

If you are able to start a terminal you should be able to manually specify the path to your old libraries inside the LD_LIBRARY_PATH variable so you can start other programs.

$ export LD_LIBRARY_PATH=/usr/lib.old

Then move your libraries back to where they were before and unset LD_LIBRARY_PATH.

$ unset LD_LIBRARY_PATH

Test if everything works as before.

And don't move all of /usr/lib/ again if you have issues with a single library.

share|improve this answer
  • OSX has a safe mode which may help you.
  • Restarting your machine may help, too.
  • If you are having trouble running commands, try putting the full path to whatever command you are using. -- (in this case the full path is /usr/lib.old/...)
share|improve this answer
    
None of those tips would help in the current situation. The programs won't run because they can't load their dynamic libraries -- none of these address that problem. –  Daenyth Jul 27 '10 at 23:11
    
do chown, chmod and cp require dlls in usr/lib? –  Robert S Ciaccio Jul 28 '10 at 1:40

have you already tried chown and chmod?
i would try booting into single user mode and then try:

chown -R root:wheel /usr/lib.old/

chmod -R 755 /usr/lib.old/

cp -R /usr/lib.old /usr/lib/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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