If the older version happens to still be locally available (true until Homebrew does one of its periodic cleanups), it will appear in brew info <package>
and you can just . Homebrew can only install versioned packages that have explicit versioned formulas, i.e., brew install
the locally available version directlypackage@version
. There used to be a brew switch
command that let you switch versions but Homebrew removed that around version 2.6 (see https://github.com/orgs/Homebrew/discussions/339 for reasons). If the old version of the package is still installed as noted above, then these commands should hopefully work.
Otherwise, you have to create a local tap for the older package version and install that. These instructions seem to be reasonably up to date.
Find the package formula in the homebrew-core
tap:
brew tap-info homebrew/core cd <homebrew prefix>/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
If you don’t already know which version you want, look in the commit log for the package formula:
git log <package>.rb
Create new local tap and extract the package version to it:
brew tap-new $USER/local-<package> brew extract --version=<version> <package> $USER/local-<package>
Watch out for weird dependency issues—you might need to edit the extracted <package>@<version>.rb
(which should be in /usr/local/Homebrew/Library/Taps/$USER/local-<package>/Formula
).
Install as usual using the new tap (obviously uninstall the currently installed version first):
brew install <package>@<version>