"Could not resolve host: github.com" error while updating Homebrew after installing git

2

0

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: github.com; nodename nor servname provided, or not known while accessing https://github.com/mxcl/homebrew.git/info/refs   
fatal: HTTP request failed
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

What happened there?

user975352

Posted 2011-11-16T17:42:07.263

Reputation: 151

1this question belongs to [su]. check your network and that you can reach github.com with your browser – CharlesB – 2011-11-16T17:43:41.677

2what does the command ping github.com return? – Stuart Carnie – 2011-11-16T17:44:24.157

Mac OS X already has git - just install the developer tools (Xcode) if you haven't already. – Paul R – 2011-11-16T17:55:43.363

@PaulR Maybe they want a more recent version? – slhck – 2011-11-16T20:26:23.460

@slhck: could be - the question isn't very clear as to motivation – Paul R – 2011-11-17T08:00:46.013

Answers

-1

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 github.com via a web browser.

porg

Posted 2011-11-16T17:42:07.263

Reputation: 279

2

Actually, you're not supposed to use sudo with Homebrew. Installation instructions say so, as does the FAQ.

– Miikka – 2011-11-16T19:25:57.457

2It's wrong to say that installation in Homebrew is "properly" done with elevated privileges. Please fix your answer. – slhck – 2011-11-16T20:25:38.313

Thanks for correcting me. I don't know brew in particular, just CLI package managers in general, and from my experience I can say that some installations require root privileges, for this cases executing via sudo can help. – porg – 2011-11-25T17:35:01.960