Macos – “Could not resolve host:” error while updating Homebrew after installing git

githomebrewmacososx lion

I'm using OS X Lion (10.7.2).

I installed Homebrew on my Mac, and I executed the command below.

$ brew install git

and then:

$ brew update
error: Could not resolve host:; nodename nor servname provided, or not known while accessing   
fatal: HTTP request failed
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

What happened there?

Best Answer

1) If you use CLI package managers such as brew, port, fink, … some installations require root privileges. In these cases run your installation command with sudo:

sudo brew install git

2) Check wether you can via a web browser.

Related Question