how to fix ‘brew install pkg-config’ 31 Mar 2013 || TechNotes • ruby on rails Trying to install pkg-config : $ brew install pkg-config [...] Warning: Could not link pkg-config. Unlinking... Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local You can try again using `brew link pkg-config' ==> Summary /usr/local/Cellar/pkg-config/0.28: 10 files, 636K Go deeper : $ brew link pkg-config Linking /usr/local/Cellar/pkg-config/0.28... Warning: Could not link pkg-config. Unlinking... Error: Could not symlink file: /usr/local/Cellar/pkg-config/0.28/share/doc/pkg-config /usr/local/share/doc/pkg-config may already exist. /usr/local/share/doc may not be writable. The solution : brew uninstall pkg-config brew install pkg-config brew link pkg-config rm -rf <offending-directory> repeat step 1 source