mac 中使用brew install 默认是安装最新版本的。
如何指定需要的版本呢?

譬如本人安装thrift。默认安装最新的。
通过brew info thrift 命令可以查看安装thrift的信息。
在这里插入图片描述
可以看到 From https://github.com/Homebrew/homebrew-core/blob/master/Formula/thrift.rb
git clone https://github.com/Homebrew/homebrew-core/blob/master/Formula/thrift.rb
然后 git log ./Formula/thrift.rb|grep -C 5 x.x.x(版本号)
就能知道项目哪个版本号是 x.x.x版本的。
然后git checkout xxxxx(git 版本号)

最后执行 brew install ./Formula/thrift.rb 就是安装对应的版本号了。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐