MacOS 使用brew安装软件指定版本

状况描述

以curl为例,因为切换了homebrew的源,当前默认版本为7.67.0,而官方源的默认版本为7.69.1,如今须要安装官方源的默认版本。(同理,其余老版本也能够使用该方法)git

安装步骤

  1. 查看软件包来源github

    $ brew info curl

    执行上述命令获得结果:shell

    From: https://mirrors.ustc.edu.cn/homebrew- core.git/Formula/curl.rb

    因为换源的缘故,获得的结果是国内源的路径。浏览器

  2. Github中查看rb版本信息curl

    • 官方源的路径为https://github.com/Homebrew/homebrew-core/blob/master/Formula/+ 软件名.rb,以curl为例,路径为:url

      https://github.com/Homebrew/homebrew-core/blob/master/Formula/curl.rb
    • 将该路径复制到浏览器中,点击Raw按钮能够得到curl.rb源文件url:code

      https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/curl.rb
    • 若是须要下载历史版本,能够点击History查看历史提交。
  3. 安装指定版本orm

    执行命令:homebrew

    $ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/curl.rb
相关文章
相关标签/搜索