在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

GitHub 加速计划 / br / brew
40.41 K
9.47 K
下载
🍺 The missing package manager for macOS (or Linux)
最近提交(Master分支:1 个月前 )
90a90b30 3 个月前
47b1cab7 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐