因为把电脑系统降级了,所以很多都重新安装,就简单重新记录下吧,反正网上教程一大堆,我只记我遇到的问题。

安装:

/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
#这是中科大镜像

为什么用镜像?因为官方的走不动啊。。。

然后遇到一个问题,是因为没有安装Command Line Tools,可以新打开一个终端窗口,然后执行:

xcode-select --install

会弹出来一个窗口等着安装就行了,这个要不了多久,安装好之后,之前安装homebrew的命令就会自动走下去。

等安装完成了,在执行以下:

git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
#这条我看了下好像可以不用?

brew update

这个是设置镜像源,也就是替换成中科大的。

具体参考官方教程吧:

https://brew.idayer.com/guide/start/

Tagged in: