Installed, just not linked

aanrv picture aanrv · Apr 2, 2015 · Viewed 92.2k times · Source

Note: I'm not so good at using shell.

I was trying to install Valgrind using brew on Yosemite.

brew install --HEAD valgrind

Towards the end, I got an error having to do with linking so when I tried to reinstall, I got:

Warning: valgrind-HEAD already installed, it's just not linked

So apparently I've already installed it. Then based on other SO questions and answers, I tried:

brew link valgrind

This seemed to solve other people's problems with linking an already installed software but this gave me an error:

Linking /usr/local/Cellar/valgrind/HEAD... 
Error: Could not symlink lib/pkgconfig/valgrind.pc
/usr/local/lib/pkgconfig is not writable.

I also tried to update brew but it didn't solve the issue. If it is not writable, maybe sudo would give me permission but I don't want to use sudo without knowing exactly what I am doing.

What is happening and how to I fix it?

Answer

Gann14 picture Gann14 · Apr 9, 2015

Looks like a permission issue. I would try doing this

chmod 755 /usr/local/lib/pkgconfig

This should make that available, then try

brew link valgrind

If that doesn't work I would try doing a check on it

brew doctor