I have a few kegs of the same package in /usr/local/Cellar/libfoo
like /usr/local/Cellar/libfoo/1.0.1
, /usr/local/Cellar/libfoo/HEAD
and /usr/local/Cellar/libfoo/mycopy
How can I brew link to a specific version?
I have a few kegs of the same package in /usr/local/Cellar/libfoo
like /usr/local/Cellar/libfoo/1.0.1
, /usr/local/Cellar/libfoo/HEAD
and /usr/local/Cellar/libfoo/mycopy
How can I brew link to a specific version?
brew switch libfoo mycopy
You can use
brew switch
to switch between versions of the same package, if it's installed as versioned subdirectories underCellar/<packagename>/
This will list versions installed ( for example I had
Cellar/sdl2/2.0.3
, I've compiled intoCellar/sdl2/2.0.4
)Then to switch between them
Info now shows
*
next to the 2.0.4To install under
Cellar/<packagename>/<version>
from source you can do for examplecheck where it gets installed with
if all looks correct
Then from
cd $(brew --Cellar)
do the switch between version.I'm using
brew version 0.9.5
The usage info:
Example:
You can find the versions installed on your system with
info
.And to see the available versions to install, you can provide a dud version number, as brew will helpfully respond with the available version numbers:
Update (15.10.2014):
The
brew versions
command has been removed from brew, but, if you do wish to use this command first runbrew tap homebrew/boneyard
.The recommended way to install an old version is to install from the
homebrew/versions
repo as follows:For detailed info on all the ways to install an older version of a formula read this answer.
if @simon's answer is not working in some of the mac's please follow the below process.
If you have already installed swiftgen using the following commands:
$
brew update
$brew install swiftgen
then follow the steps below in order to run swiftgen with older version.
Step 1:
brew uninstall swiftgen
Step 2: Navigate to: https://github.com/SwiftGen/SwiftGen/releases and download the swiftgen with version: swiftgen-4.2.0.zip.Unzip the package in any of the directories.
Step 3: Execute the following in a terminal:
You should get: SwiftGen v0.0 (Stencil v0.8.0, StencilSwiftKit v1.0.0, SwiftGenKit v1.0.1)
If you have installed, for example, php 5.4 it could be switched in the following way to php 5.5:
I asked in #machomebrew and learned that you can switch between versions using brew switch.
to get version mycopy of libfoo.