- touch brew_install.txt
- 访问https://raw.githubusercontent.com/Homebrew/install/master/install.sh,将其内容CV至文本文件中。
- command+F搜索https://github.com/Homebrew/brew,替换为https://mirrors.ustc.edu.cn/brew.git中科大国内镜像源。
- 执行/bin/bash /Users/admin/Desktop/brew_install.txt
- cd /opt/homebrew/Library/Taps/homebrew,如果里面有homebrew-core则使用sudo rm -rf homebrew-core先将其删除。
- 重新克隆 git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
- 修改brew配置文件,否则会出现-bash: brew: command not found。
- cd ~
- sudo vim ./bash_profile
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/binexport PATH=/opt/homebrew/bin 我的~/.bash_profile需要先将此优先写入source ~/.bash_profile后。brew才能使用,但若想使用ls,则循环执行第一步。。- 再使用brew install nginx,修改nginx.conf
mac极速安装homebrew(M1最新版)
最新推荐文章于 2024-02-01 22:31:52 发布