Note: I\'m not so good at using shell.
I was trying to install Valgrind
using brew
on Yosemite.
brew install --HEAD valgrind<
brew install cocoapods --build-from-source
brew link --overwrite cocoapods
The only commands that worked for me on after upgrading to MAC OS Mojave 10.14.6
Here is what I tried and it worked:
$ brew link --overwrite sdl
Linking /usr/local/Cellar/sdl/1.2.15...
Error: Could not symlink lib/pkgconfig/sdl.pc
/usr/local/lib/pkgconfig is not writable.
Looked for pkgconfig
: (after chmod 750
)
drwxr-xr-x 4 root wheel 136B Mar 30 2013 pkgconfig
I tried chown
as below:
$ sudo chown -R avkashchauhan:admin /usr/local/lib/pkgconfig
it should look like as below:
drwxr-xr-x 4 avkashchauhan admin 136B Mar 30 2013 pkgconfig
After I tried it:
$ brew link sdl
Linking /usr/local/Cellar/sdl/1.2.15... 182 symlinks created
First run
brew link <package>
If it gives an error, try for an automated diagnosis
brew doctor
brew doctor
gives a list of problems that could be leading to errors in installation process.
To fix problems in case of conflicting files, run to get a list of all actions which will be performed by overwrite without actually performing them.
To list all files that would be deleted:
brew link --overwrite --dry-run <package>
followed by this run which will execute the overwrite, assuming you feel that the actions performed by overwrite will take your system to a more stable state.
To force the link and overwrite all conflicting files:
brew link --overwrite <package>
If none of above the solution works, try this.
sudo chown -R $USER:admin /usr/local
brew link <package-name>