I am getting the following error when trying to install imagemagick via brew on OS X Mountain Lion. It appears to be a curl error - hence why it's on SF not another of the Stack Exchange sites.

brew install imagemagick
==> Installing imagemagick dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz

curl: (7) couldn't connect to host
Error: Download failed: http://pkgconfig.freedesktop.org/releases/pkg-config-0.27.tar.gz

Is it possible to pick an alternative download location when running the brew install imagemagick command?

Is this a known problem, I have searched for similar issues but none seem to be the same.


I was having this exact problem (today as well, found your post while searching for a result)

The following worked for me:

cd /Library/Caches/Homebrew
curl -O http://fossies.org/unix/privat/pkg-config-0.27.tar.gz
brew install imagemagick

Basically Homebrew will not re-download a file that it has cached, so its just about downloading the file from somewhere else (finding it was the hard part)

  • Great, thanks! I was just in the process of trying to find that file aswell! You've saved me a chunk of wasted time. – dannymcc Aug 2 '12 at 11:16

I didn't have a /Homebrew folder in my /Library/Caches directory. I made one and got the file, but brew install graphviz still tried the old formula's URL.

I instead went to /usr/local/Library/Formula and edited the url property of pkg-config.rb to be that new URL from Stephen's answer.

This worked well, and then I did a brew update to reset the recipes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.