一招教你怎么使用mac 安装配置 homebrew(代码分享)插图

最近换电脑了,发现homebrew安装不上了,我感觉是网络问题,连了个vpn,发现还是不行,哈哈,是姿势不对

安装

运行下面自动脚本(已经全部替换为国内地址):

(Mac)常规安装脚本(推荐完全体几分钟安装完成)

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

(Mac)精简版几秒钟安装完成

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed

(Mac)卸载脚本

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"

(Linux)安装脚本:

rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh

(Linux)卸载脚本:

rm HomebrewUninstall.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh ; bash HomebrewUninstall.sh

安装问题

如果发现有各种安装不上的运行:

sudo rm -rf /usr/local/Homebrew

提示系统太旧的 (Failed to install Homebrew Portable Ruby (and your system version is too old)!) 运行:

HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles-portable-ruby

rm -rf /Users/$(whoami)/Library/Caches/Homebrew/

brew update

切换镜像源

阿里云homebrew

配置方法:[https://developer.aliyun.com/mirror/homebrew]。

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

腾讯云homebrew

配置方法:Homebrew镜像使用帮助

[https://mirrors.cloud.tencent.com/help/homebrew.html]。

cd "$(brew --repo)"
git remote set-url origin http://mirrors.cloud.tencent.com/git/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin http://mirrors.cloud.tencent.com/git/homebrew/homebrew-core.git

brew update

配置方法:Homebrew-bottles镜像使用帮助

[https://mirrors.cloud.tencent.com/help/homebrew-bottles.html]。

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.cloud.tencent.com/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

中科大homebrew

配置方法:Homebrew源使用帮助[http://mirrors.ustc.edu.cn/help/brew.git.html]。

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

配置方法:Homebrew Core源使用帮助[http://mirrors.ustc.edu.cn/help/homebrew-core.git.html]。

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

配置方法:Homebrew Bottles源使用帮助[http://mirrors.ustc.edu.cn/help/homebrew-bottles.html]。

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

推荐学习:MacOS教程

以上就是一招教你怎么使用mac 安装配置 homebrew(代码分享)的详细内容,更多请关注亿码酷站其它相关文章!


一招教你怎么使用mac 安装配置 homebrew(代码分享)
—–文章转载自PHP中文网如有侵权请联系ymkuzhan@126.com删除

下载声明:
  • 本站资源如无特殊说明默认解压密码为www.ymkuzhan.com建议使用WinRAR解压;
  • 本站资源来源于用户分享、互换、购买以及网络收集等渠道,本站不提供任何技术服务及有偿服务,资源仅提供给大家学习研究请勿作它用。
  • 赞助本站仅为维持服务器日常运行并非购买程序及源码费用因此不提供任何技术支持,如果你喜欢该程序,请购买正版!
  • 版权声明:
  • 下载本站资源学习研究的默认同意本站【版权声明】若本站提供的资源侵犯到你的权益,请提交版权证明文件至邮箱ymkuzhan#126.com(将#替换为@)站长将会在三个工作日内为您删除。
  • 免责声明:
  • 您好,本站所有资源(包括但不限于:源码、素材、工具、字体、图像、模板等)均为用户分享、互换、购买以及网络收集而来,并未取得原始权利人授权,因此禁止一切商用行为,仅可用于个人研究学习使用。请务必于下载后24小时内彻底删除,一切因下载人使用所引起的法律相关责任,包括但不限于:侵权,索赔,法律责任,刑事责任等相关责任,全部由下载人/使用人,全部承担。以上说明,一经发布视为您已全部阅读,理解、同意以上内容,如对以上内容持有异议,请勿下载,谢谢配合!支持正版,人人有责,如不慎对您的合法权益构成侵犯,请联系我们对相应内容进行删除,谢谢!