docs/Versions.md
homebrew/core supports multiple versions of formulae by using a special naming format. For example, the formula for GCC 9 is named [email protected] and begins with class GccAT9 < Formula.
This page is about versioned formulae such as [email protected]. Formula variants such
as foo-full are not versioned formulae: they are separate formulae used to
provide a different dependency or feature trade-off and follow the
[Homebrew/homebrew-core dependency policy]({% link Homebrew-homebrew-core-Maintainer-Guide.md %}#dependencies-and-full-variants)
instead.
Versioned formulae we include in homebrew/core must meet the following standards:
formula2 rather than formula@2 or formula@1).[email protected] and foo, and foo depends on openssl then you must instead use openssl.keg_only :versioned_formula to allow users to have multiple versions installed at once.keg_only :versioned_formula should not post_install anything in the HOMEBREW_PREFIX that conflicts with or duplicates the main counterpart (or other versioned formulae). For example, a node@6 formula should not install its npm into HOMEBREW_PREFIX like the node formula does.install_on_request formulae.resources that require security updates. For example, a node@6 formula should not have an npm resource but instead rely on the npm provided by the upstream tarball.revision bumps to be rebuilt against newer versions. Version updates which violate this should be rejected and the formula be deprecated from that point onwards.Homebrew's versions should not be used to "pin" formulae to your personal requirements. If a versioned formula already exists in homebrew/core, prefer that first: it remains supported and updated by Homebrew.
If you want something else, choose the smallest tool that fits:
brew pinUse brew pin <formula> when you want brew upgrade to stop upgrading a formula you already have installed.
Pros:
Cons:
$HOMEBREW_NO_AUTO_UPDATEUse export HOMEBREW_NO_AUTO_UPDATE=1 when you want Homebrew to stop automatically refreshing formula and cask metadata until you choose to run brew update.
Pros:
brew updateCons:
brew upgrade from changing installed formulaebrew updateIf you are using brew bundle, combine this with brew bundle --no-upgrade or export HOMEBREW_BUNDLE_NO_UPGRADE=1 if you also want brew bundle to stop upgrading installed dependencies.
brew bundle --no-upgrade and $HOMEBREW_BUNDLE_NO_UPGRADEUse brew bundle --no-upgrade or export HOMEBREW_BUNDLE_NO_UPGRADE=1 when you want brew bundle to stop running brew upgrade on outdated dependencies.
Pros:
brew bundleCons:
brew install may still upgrade a dependency if needed$HOMEBREW_NO_INSTALL_UPGRADEUse export HOMEBREW_NO_INSTALL_UPGRADE=1 when you want brew install <formula> to stop upgrading an already installed but outdated formula.
Pros:
brew installCons:
brew upgrade$HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECKUse export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 when you want Homebrew to skip checking for outdated or broken installed dependents after installs, upgrades, or reinstalls.
Pros:
Cons:
brew install or brew upgradebrew version-installUse brew version-install when you want a simpler workflow to extract a specific older formula version into your own tap and install it.
Pros:
Cons:
brew extractUse brew extract when you want the lower-level workflow and to manage the extracted formula file yourself in a tap. See How to Create and Maintain a Tap for more information.
Pros:
Cons:
Homebrew supports these commands and local workflows, but it does not commit to maintaining every frozen or extracted formula version for you. Before submitting Homebrew issues, run brew update first and reproduce with current metadata. If you use brew pin, $HOMEBREW_NO_AUTO_UPDATE, $HOMEBREW_BUNDLE_NO_UPGRADE, $HOMEBREW_NO_INSTALL_UPGRADE, $HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK, brew version-install, or brew extract, you must only file issues when you can reproduce with core formulae. If you maintain formulae in your own tap, those formulae, their deprecations, and their security updates are your responsibility. If you or your organisation need long-term control over formula versions, create your own tap. A brew upgrade breaking your local frozen or extracted formula is not an argument for Homebrew to add and maintain another historical version in homebrew/core.
If there is a formula that currently exists in the Homebrew/homebrew-core repository or has existed in the past (i.e. was migrated or deleted), you can recover it for your own use with the brew version-install command. This will install the desired version of the formula from your own custom tap. For example, if your project depends on automake 1.12 instead of the most recent version, you can obtain the automake formula at version 1.12 by running:
brew version-install [email protected]
Formulae obtained this way may contain deprecated, disabled or removed Homebrew syntax (e.g. checksums may be sha1 instead of sha256); the brew version-install command does not edit or update formulae to meet current standards and style requirements.
We may temporarily add versioned formulae for our own needs that do not meet these standards in homebrew/core. The presence of a versioned formula there does not imply it will be maintained indefinitely or that we are willing to accept any more versions that do not meet the requirements above.