Reputation: 13645
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.
Upvotes: 1
Views: 149
Reputation: 62456
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 [email protected]
or brew install [email protected]
. This works because there is the corresponding formulas: [email protected] and [email protected].
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
Upvotes: 1