专业的编程技术博客社区

网站首页 > 博客文章 正文

Mac更换Homebrew 阿里云的源(yum更换阿里源)

baijin 2024-09-02 11:08:15 博客文章 5 ℃ 0 评论

mac上用homebrew经常卡在更新homebrew本身上

使用以下命令更换国内阿里云上的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

# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

Tips: 注意自己机器的环境可能不是 ~/.zshrc,比如:~/.bashrc

如果更换源之后还是很慢可以加上 --verbose 查看具体原因

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表