homebrew安装及源加速

homebrew安装及源加速

官方网站:http://brew.sh
其它包管理器:



安装:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
或者直接用国内源安装
cd /usr/local
git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git
或(git clone http://mirrors.ustc.edu.cn/homebrew.git)


加速方案:
1.更换国内源

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

//coding.net

git remote set-url origin https://git.coding.net/homebrew/homebrew.git

homebrew安装及源加速

jlive@MacBook-Pro:~ $brew install screenfetch

==> Downloading https://homebrew.bintray.com/bottles/screenfetch-3.7.0.el_capitan.bottle.tar.gz

######################################################################## 100.0%

==> Pouring screenfetch-3.7.0.el_capitan.bottle.tar.gz

 

🍺  /usr/local/Cellar/screenfetch/3.7.0: 7 files, 240K

jlive@MacBook-Pro:~ $screenfetch 


                 -/+:.          jlive@MacBook-Pro

                :++++.          OS: 64bit Mac OS X 10.11.2 15C50

               /+++/.           Kernel: x86_64 Darwin 15.2.0

       .:-::- .+/:-``.::-       Uptime: 1h 16m

    .:/++++++/::::/++++++/:`    Packages: 77

  .:///////////////////////:`   Shell: bash 3.2.57

  ////////////////////////`     Resolution: 2880x1800

 -+++++++++++++++++++++++`      DE: Aqua

 /++++++++++++++++++++++/       WM: Quartz Compositor

 /sssssssssssssssssssssss.      WM Theme: Graphite

 :ssssssssssssssssssssssss-     CPU: Intel Core i7-4870HQ CPU @ 2.50GHz

  osssssssssssssssssssssssso/`  GPU: AMD Radeon R9 M370X / Intel Iris Pro 

  `syyyyyyyyyyyyyyyyyyyyyyyy+`  RAM: 11117MiB / 16384MiB

   `ossssssssssssssssssssss/   

     :ooooooooooooooooooo+.    

 

      `:+oo+/:-..-:/+o+/- 


2.代理

brew下载包默认使用curl,所以针对curl做代理即可

cat > ~/.curlrc  <<EOF

proxy = 127.0.0.1:1087

EOF



问题:

1.High Sierra中chown: /usr/local: Operation not permitted

https://github.com/Homebrew/brew/issues/3228

解决方案:

sudo chown -R $(whoami) $(brew --prefix)/*

如果还未解决,可以尝试重新安装homebrew,我的情况是重新安装homebrew后解决的


posted @ 2015-12-07 22:21  李庆喜  阅读(1521)  评论(0编辑  收藏  举报