Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing PostgreSQL via Homebrew on Mac

When installing PostgreSQL via Homebrew on Mac (OSX 10.11.6) I get the following errors:

Error: The `brew link` step did not complete successfully The formula
  built, but is not symlinked into /usr/local

and

initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist
  This might mean you have a corrupted installation or identified the 
  wrong directory with the invocation option -L.

The /postgresql folder doesn't exist.

Not sure if it's relevant, but I already have OpenSSL 1.0.2o_2 and Readline 7.0.5 installed via Homebrew.

Does anyone know why this error occurs and how I can solve it?

like image 613
Robert Samarji Avatar asked Sep 06 '25 03:09

Robert Samarji


1 Answers

In my case, I had installed libpq which prevented postgresql from linking. Unlinking libpq followed by linking postgresql fixed the issue for me.

brew unlink libpq
brew link postgresql
brew postinstall postgresql
like image 171
ChrisM Avatar answered Sep 07 '25 19:09

ChrisM