如何在自制程序中安装特定版本的公式?例如,postgresql-8.4.4而不是最新的9.0。


当前回答

brew版本和brew安装https://raw.githubusercontent.com/Homebrew/homebrew-core/现在不支持<COMMIT-HASH>/Formula/<Formula>.rb。

您可以这样尝试:

$ brew extract --version 5.6.2 gradle vitahlin/core
$ brew install gradle@5.6.2

其他回答

我创建了一个工具来简化这个答案中规定的过程。

要查找a.b.c版本的软件包pkg,请运行:

$ brew-install-specific pkg@a.b.c

这将列出pkg-homebrew公式中提到给定版本的提交及其GitHub URL。

Matching versions:
1. pkg: update a.b.c bottle.
   https://github.com/Homebrew/homebrew-core/commit/<COMMIT-SHA>
2. pkg: release a.b.c-beta
   https://github.com/Homebrew/homebrew-core/commit/<COMMIT-SHA>
3. pkg a.b.c
   https://github.com/Homebrew/homebrew-core/commit/<COMMIT-SHA>

Select index: 

验证来自给定URL的提交,并输入所选提交的索引。

Select index: 2
Run:
  brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/<COMMIT-SHA>/Formula/pkg.rb

复制并运行给定的命令进行安装。

brew版本和brew安装https://raw.githubusercontent.com/Homebrew/homebrew-core/现在不支持<COMMIT-HASH>/Formula/<Formula>.rb。

您可以这样尝试:

$ brew extract --version 5.6.2 gradle vitahlin/core
$ brew install gradle@5.6.2

按照@halfcube的建议,这非常有效:

查找您要查找的库https://github.com/Homebrew/homebrew-core/tree/master/Formula单击它:https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb单击“历史记录”按钮查看旧提交:https://github.com/Homebrew/homebrew-core/commits/master/Formula/postgresql.rb单击所需的选项:“postgresql:update version to 8.4.4”,https://github.com/Homebrew/homebrew-core/blob/8cf29889111b44fd797c01db3cf406b0b14e858c/Formula/postgresql.rb单击“原始”链接:https://raw.githubusercontent.com/Homebrew/homebrew-core/8cf29889111b44fd797c01db3cf406b0b14e858c/Formula/postgresql.rbbrew安装https://raw.githubusercontent.com/Homebrew/homebrew-core/8cf29889111b44fd797c01db3cf406b0b14e858c/Formula/postgresql.rb

我发现了比其他复杂解决方案更好的替代方案。

brew install https://raw.github.com/Homebrew/homebrew-versions/master/postgresql8.rb

这将下载并安装PostgreSQL 8.4.8


我通过开始遵循搜索回购和回购中的注释的步骤找到了这个解决方案。

经过一番研究发现,有人收集了一些罕见的配方奶粉。


如果您正在查找MySQL 5.1.x,请尝试一下。

brew install https://raw.github.com/Homebrew/homebrew-versions/master/mysql51.rb

对于当前不在默认酿造配方中的版本,您可以使用以下工具轻松创建自己的水龙头:https://github.com/buildtools-version-taps/homebrew-versions-tap-tool