1

homebrew supports the installation of different versions of a package.

Homebrew install specific version of formula?

But I don't see different versions specified in homebrew formulas.

https://github.com/Homebrew/homebrew-core/blob/master/Formula/bash.rb

Does anybody know how the support of different versions of a package is implemented in homebrew? Thanks.

user1424739
  • 7,204
  • 10
  • 38
  • 67

1 Answers1

1

There is at least three different ways package versions are supported by Homebrew.

1) With brew switch, you can switch back to a version of a package you already installed. For example typing brew switch ansible, I obtain:

ansible installed versions: 2.7.5, 2.7.6

using brew switch ansible 2.7.5, I can switch back to an old version, but this works only for versions that have been already installed.

2) With versioned formulas, you can choose an old version of MySQL with brew install mysql@5.5 or brew install mysql@5.6. This works because there is the corresponding formulas: mysql@5.5.rb and mysql@5.6.rb.

3) You can use the git history to go back to any version of a formula, read this question/answer for details: Install older version of Pandoc (<2) using homebrew

Ortomala Lokni
  • 41,102
  • 15
  • 134
  • 190