mac install brew过程&问题解决
1. mac install brew过程
过程请参考 :
https://blog.csdn.net/tterminator/article/details/47404877
简单说 , 就是一行命令搞定 :
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
( homebrew官方有可能更新了安装脚本,所以在安装brew时 , 上述安装脚本推荐从官方copy,官方网站如下:http://brew.sh/index_zh-cn.html。)
2. 遇到问题总结
error: could not lock config file /usr/local/Homebrew/.git/config: Permission denied
fatal: could not set 'core.repositoryformatversion' to '0'
Failed during: git init -q
3. 解决结果
从错误信息看,是获取homebrew版本库时遇到Permission denied。
查阅 https://raw.githubusercontent.com/Homebrew/install/master/install 可知,脚本尝试将版本库获取到`/usr/local`下。此时遇到Permission denied错误。
因此需要确保对`/usr/local`的完全访问权限,请尝试通过`sudo chown -R $(whoami) /usr/local`修改权限。
4.安装过程
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==>This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==>Downloading and installing Homebrew...
remote: Counting objects: 3693, done.
remote: Compressing objects: 100% (3525/3525), done.
remote: Total 3693 (delta 38), reused 527 (delta 27), pack-reused 0
Receiving objects: 100% (3693/3693), 3.04 MiB | 79.00 KiB/s, done.
Resolving deltas: 100% (38/38), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 9c41fb8 update man page
==>Installation successful!
==> Next steps
Run `brew help` to get started
5.验证是否安装成功
terminal输入brew help , 出现如下 :
Example usage:
brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]
Troubleshooting:
brew config
brew doctor
brew install -vd FORMULA
Developers:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
https://docs.brew.sh/Formula-Cookbook
OK , 安装成功~ !
Further help:
man brew
brew help [COMMAND]
brew home