MacOS 使用brew安装软件指定版本
文章目录
情况描述
以curl为例,由于切换了homebrew的源,当前默认版本为7.67.0,而官方源的默认版本为7.69.1,现在需要安装官方源的默认版本。(同理,其他老版本也可以使用该方法)
安装步骤
-
查看软件包来源
$ brew info curl执行上述命令得到结果:
From: https://mirrors.ustc.edu.cn/homebrew- core.git/Formula/curl.rb由于换源的缘故,得到的结果是国内源的路径。
-
Github中查看rb版本信息
-
官方源的路径为
https://github.com/Homebrew/homebrew-core/blob/master/Formula/+ 软件名.rb,以curl为例,路径为:https://github.com/Homebrew/homebrew-core/blob/master/Formula/curl.rb -
将该路径复制到浏览器中,点击
Raw按钮可以获得curl.rb源文件url:https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/curl.rb - 如果需要下载历史版本,可以点击
History查看历史提交。
-
-
安装指定版本
执行命令:
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/curl.rb
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论