Repairing broken symbolic link

A symbolic link may become broken due to updating/compiling/installing software, showing up as red text in ls Terminal.

Suppose the broken link is named foo.so, here’s how to fix it.

  1. find where link pointed to:
    readlink -v foo.so
    
  2. Point link to new file (perhaps foo2.so)
    ln -sfn foo2.so foo.so
    
  3. verify new link is blue color
    ls foo.so
    

Categories:

Updated:

Leave a Comment