× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

OSX homebrew: link errors when installing over previously installed packages

Jessamyn Smith
May 01, 2015
<p>It is fairly common to run into installation errors with homebrew due to previous non-homebrew installs of packages. Even if you try to uninstall, there are often conflicting directories or symlinks, and if you did the previous installation as root / with sudo, there may be permissions errors as well.</p> <ol> <li>Start with running "brew doctor" to make sure your system is in good shape, and follow any directions it gives you.</li> <li>Next, follow any uninstall directions for the package.</li> <li>Do "brew list" to verify that the package you want to install is no longer in the list.</li> <li>Do "brew install &lt;packagename&gt;" (you will likely see issues with the link step, in particular)</li> <li>If you get an error in brew link, i.e. that the directory already exists, investigate that directory to ensure it doesn't contain anything other than the package you want to get rid of (you can do this by "ls -al &lt;dir/in/brew/error&gt;"). If it is empty other than the package you are trying to install, you can "rm -rf &lt;dir/in/brew/error&gt; to delete the directory. If it does contain other things, try removing just the offending file. You may need to <a href="http://www.maclife.com/article/columns/terminal_101_changing_file_owner_chown">change directory ownership</a> from root to yourself, if that's an issue.</li> <li>Try running "brew link &lt;packagename&gt;". If you get errors, repeat steps 5 and 6 until brew link completes successfully.</li> </ol>
comments powered by Disqus