赞
踩
有时候用用brew 在mac安装软件,但是发现,brew更新起来,慢的要死啊~~!!很多时候都是卡住不动的,所以,就去找解决的办法了。下面找到一篇,贴出来:
Brew 是OS X 上类似apt-get以及yum的一个软件包管理器,它依托于Github………………
所以,虽然你侥幸下载到了 brew,但你肯定是无法更新 brew 的。原因你懂。不过虽然不能更新 brew,但这只是指brew这个管理器本身罢了,软件还是可以安装的。但由于无法使用 brew update 也就无法更新软件……我们有必要来给 brew 换源。
注意,如果你按照让 Homebrew 走代理更新这篇文章来操作了,那你就没有必要切换镜像源,因为已经全局代理了,否则的话会导致brew无法更新——因为国外也不能轻易访问国内的。
如果你两者都做了,那么就需要使用下面的命令重新安装 brew :
1
2
3
|
ruby
-
e
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
ruby
-
e
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
brew 也有镜像源?嗯,确实有的,而且还不止一个:
1
2
3
4
5
6
|
cd
/
usr
/
local
git
remote
set
-
url
origin
git
:
//mirrors.tuna.tsinghua.edu.cn/homebrew.git
//清华镜像源
git
remote
set
-
url
origin
http
:
//mirrors.ustc.edu.cn/homebrew.git
//中科大镜像源
//二者选其一即可更新
|
1
2
3
4
5
6
7
8
9
10
11
|
cd
~
mkdir
tmp
cd
tmp
//以下要与你选择的镜像源相同
git
clone
git
:
//mirrors.tuna.tsinghua.edu.cn/homebrew.git
git
clone
http
:
//mirrors.ustc.edu.cn/homebrew.git
sudo
rm
-
rf
/
usr
/
local
/
.
git
sudo
rm
-
rf
/
usr
/
local
/
Library
sudo
cp
-
R
homebrew
/
.
git
/
usr
/
local
/
sudo
cp
-
R
homebrew
/
Library
/
usr
/
local
/
|
如果你遇到如下问题:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
╰─➤
brew
update
Stashing
your
changes
:
M
.
gitignore
M
.
yardopts
M
README
.
md
M
share
/
doc
/
homebrew
/
Acceptable
-
Formulae
.
md
M
share
/
doc
/
homebrew
/
Common
-
Issues
.
md
M
share
/
doc
/
homebrew
/
FAQ
.
md
M
share
/
doc
/
homebrew
/
Formula
-
Cookbook
.
md
M
share
/
doc
/
homebrew
/
Homebrew
-
0.9
.
3
.
md
M
share
/
doc
/
homebrew
/
How
-
To
-
Open
-
a
-
Homebrew
-
Pull
-
Request
-
(
and
-
get
-
it
-
merged
)
.
md
D
share
/
doc
/
homebrew
/
How
-
to
-
Create
-
and
-
Maintain
-
a
-
Tap
.
md
M
share
/
doc
/
homebrew
/
How
-
to
-
build
-
software
-
outside
-
Homebrew
-
with
-
Homebrew
-
keg
-
only
-
dependencies
.
md
M
share
/
doc
/
homebrew
/
Installation
.
md
M
share
/
doc
/
homebrew
/
Interesting
-
Taps
-
&
-
Branches
.
md
M
share
/
doc
/
homebrew
/
Maintainer
-
Guidelines
.
md
M
share
/
doc
/
homebrew
/
Press
.
md
M
share
/
doc
/
homebrew
/
Python
-
for
-
Formula
-
Authors
.
md
M
share
/
doc
/
homebrew
/
Querying
-
Brew
.
md
M
share
/
doc
/
homebrew
/
README
.
md
D
share
/
doc
/
homebrew
/
Rename
-
A
-
Formula
.
md
M
share
/
doc
/
homebrew
/
Troubleshooting
.
md
M
share
/
doc
/
homebrew
/
Xcode
.
md
M
share
/
doc
/
homebrew
/
brew
-
tap
.
md
M
share
/
man
/
man1
/
brew
.
1
fatal
:
Unable
to
create
'/usr/local/.git/index.lock'
:
Permission
denied
Cannot
save
the
current
index
state
Error
:
Failure
while
executing
:
git
stash
save
--
include
-
untracked
--
quiet
|
那么就安照如下命令排错:
1
2
3
4
|
sudo
chgrp
-
R
admin
/
usr
/
local
//确保目录归属管理组
sudo
chmod
-
R
g
+
w
/
usr
/
local
//确保管理组可读
|
没了,运行 brew update 来愉快地更新吧!然后 brew upgrade 。?
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。