标签:命令 镜像 操作 国内 res clean 清华大学 演示 如何
Homebrew是什么?
如何安装Homebrew?
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Homebrew几点备注.
/usr/local/Cellar
目录./usr/local/bin
目录.brew install [包名]
brew update
brew update -verbose
brew cleanup
:清理旧有软件包.brew doctor
:诊断Homebrew的问题.brew update-reset
brew install [软件包]
安装其他软件包,卡在Updating Homebrew...brew update
更新brew,半天没反应.Control-C
直接终止当前前台update进程,然后brew就会接着执行install了.github.com
上,因为一些原因,国内访问不太顺畅.brew update -verbose
我们可以看到brew update
工作的具体步骤.$ brew update -verbose
Checking if we need to fetch /usr/local/Homebrew...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Fetching /usr/local/Homebrew...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Already up-to-date.
Homebrew
,homebrew-cask
,homebrew-core
,homebrew-services
这几个文件.Homebrew
和homebrew-core
这两个的源.homebrew-cask
这个文件上,而我之前运行brew update -verbose
显示卡死也的确是卡在这个地方.homebrew-cask
这个文件的更新源也替换一下即可.Homebrew
源.
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
"$(brew --repo)"
是用来自动指向Homebrew的目录的.homebrew-core
源.
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
homebrew-cask
源.
$ cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
Homebrew-bottles
的镜像源.
标签:命令 镜像 操作 国内 res clean 清华大学 演示 如何
原文地址:https://www.cnblogs.com/bfyang5130/p/12983831.html