Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix 'brew install pkg-config'?

Tags:

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`‏‏‏‏‏‏ 
like image 968
dpott197 Avatar asked Nov 20 '12 22:11

dpott197


People also ask

What is pkg-config Mac?

pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test.

Where is pkg-config in Ubuntu?

On most systems, pkg-config looks in /usr/lib/pkgconfig , /usr/share/pkgconfig , /usr/local/lib/pkgconfig and /usr/local/share/pkgconfig for these files. It will additionally look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.


2 Answers

  1. brew reinstall pkg-config
  2. rm -R offending-directory
  3. repeat step 1
like image 85
dpott197 Avatar answered Nov 29 '22 09:11

dpott197


As Michael Pigg said above, in my case it was the folder permission issue. I had to do the following:

sudo chmod 777 /usr/local/bin sudo chmod 777 /usr/local/share/man/man1 brew link pkg-config 

And after I'm done:

sudo chmod 755 /usr/local/bin sudo chmod 755 /usr/local/share/man/man1 

to restore the original permissions.

like image 42
kakyo Avatar answered Nov 29 '22 11:11

kakyo