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 it caused some issues. 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)???

  • I don't have my install DVD either as I just moved and can't find where I packed it! Commented Jul 27, 2010 at 5:27

4 Answers 4


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.

  • 1
    well good on ya for solving your own problem :P Commented Jul 28, 2010 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. Commented Jul 4, 2011 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.


Test if everything works as before.

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

  • 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/...)
  • 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
    Commented Jul 27, 2010 at 23:11
  • do chown, chmod and cp require dlls in usr/lib? Commented Jul 28, 2010 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/

You must log in to answer this question.

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