![brew 更新超时](https://linux22.com/image/1376256/brew%20%E6%9B%B4%E6%96%B0%E8%B6%85%E6%97%B6.png)
这让我抓狂。我无法再更新我的自制软件安装。当我运行 时brew update
,它什么也不做并且超时。
我甚至尝试重新安装它,但当我使用默认安装程序时,我遇到了同样的问题。我最终使用了“Untar anywhere”(https://github.com/mxcl/homebrew/wiki/Installation) 选项,效果很好。但我仍然无法更新 homebrew。
→ brew update
Initialized empty Git repository in /usr/local/homebrew/.git/
error: Failed connect to github.com:3128; Operation timed out while accessing https://github.com/mxcl/homebrew.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Error: Failure while executing: git fetch origin
在详细模式下运行并没有太大的帮助:
→ brew update -v
git init
Initialized empty Git repository in /usr/local/homebrew/.git/
git config core.autocrlf false
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
error: Failed connect to github.com:3128; Operation timed out while accessing https://github.com/mxcl/homebrew.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Error: Failure while executing: git fetch origin
输出如下brew --config
:
→ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/homebrew/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.4-x86_64
Xcode: 4.6.3
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
答案1
事实证明,很久以前我在防火墙后面工作时为 git 设置了代理。要从 git 中删除代理,我只需运行:
→ git config --global http.proxy ''
一切又恢复正常了!