MAC切换brew源为其他国内源
·
在brew install yara时发现中科大的源中缺少包,于是换个源试试,当然,也可以手动下载一下。(最后附了可手动下载的其他源地址及下载方法)
1、看需要修改哪些地方
# 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...
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services...

更新时需要检查这4个文件夹
我们需要替换其中的3个:
/usr/local/Homebrew
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
2、替换(我替换为清华源)
# cd "$(brew --repo)"
# git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
# git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
# git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
3、升级
# brew update

搞定~ 换源成功~
4、手动下载
中科大源
https://mirrors.ustc.edu.cn/brew.git
清华源
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
阿里源
https://mirrors.aliyun.com/homebrew/brew.git
腾讯源
https://mirrors.cloud.tencent.com/homebrew/brew.git
缺少某版本包时,可到上面的源中手动下载到本地
然后移动到brew --cache文件夹内
最后brew install 安装即可
参考文章:
https://blog.miuyun.work/archives/19233913
https://www.jianshu.com/p/bea984d27cd2
https://www.cnblogs.com/bfyang5130/p/12983831.html
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)