Homebrew是MacOS系统上最流行的软件包管理器,当你看到 Warning: You are using macOS 12. We (and Apple) do not provide support for this old version.
提示的时候就说明安装的homebrew版本已经不再支持你的操作系统版本了,这就导致你用brew命令安装一些软件的时候编译可能不兼容的新源导出报错安装不成功,根据说明是因为他们基础架构容量有限,因此他们只在最新的3个macOS版本上进行构建。
有的老机型已经不能往上升级操作系统版本,这时就需要降级homebrew版本冻结在当前系统能用的版本。以下以macOS12版本为例:
1.查找homebrew什么版本开始停止对你的系统版本支持

2.根据上面的日期和版本号,去github仓库找支持系统的git 版本号,https://github.com/Homebrew/homebrew-core/commit/46f4b41,可以看到是从这个分支开始去除了macOS12 Monterey的,那么我们就固定在上个提交da66cc3
# homebrew/core
cd $(brew --repository)/Library/Taps/homebrew/homebrew-core/
git checkout -b macOS-monterey-freeze da66cc3
# homebrew
cd $(brew --repository)
git checkout -b macOS-monterey-freeze 9042eb9
3.最后配置不要自动更新,需要在 shell 环境中设置(bash_profile或profile或zshrc)
export HOMEBREW_NO_AUTO_UPDATE=true
export HOMEBREW_NO_INSTALL_FROM_API=1
参考资料:
macOS 12 不受支持?:https://github.com/orgs/Homebrew/discussions/5603#discussioncomment-11253847
开源维护者不欠你任何东西:https://mikemcquaid.com/open-source-maintainers-owe-you-nothing
正文完