@Konboi memo

主に技術に関してつらつらと。

homebrew で旧バージョンのものを使いたい

この前 homebrew でImageMagick をアップデートしたら、依存のライブラリが全滅したので古い バージョンを入れなおした。

そのとき結構調べたのでメモっておく。

手順

現在のバージョンを調べる

brew info [調べたいパッケージ]

で調べられる。

インストールできるバージョンを調べる

brew versions [インストールしたいパッケージ]

インストールするバージョンのFomulaをcheckoutする

git checkout [インストールしたいバージョンのパッケージのリビジョン]

インストールされるバージョンを確認する

brew info [インストールしたいパッケージ]

バージョンが変更になっていたらインストールする

brew install [インストールしたいパッケージ]

こんな感じ。

$ brew info imagemagick
(git)-[master]-[~/.emacs.d/conf]
imagemagick: stable 6.7.7-6, HEAD
http://www.imagemagick.org

$ brew versions imagemagick                                                                                                                                                                                                                      (git)-[master]-[~/.emacs.d/conf]
6.7.7-6  git checkout 883f549 /Users/current-user/local/homebrew/Library/Formula/imagemagick.rb
6.7.5-7  git checkout f965101 /Users/current-user/local/homebrew/Library/Formula/imagemagick.rb
6.7.1-1  git checkout be8e0ff /Users/current-user/local/homebrew/Library/Formula/imagemagick.rb
6.6.9-4  git checkout 4e7c332 /Users/current-user/local/homebrew/Library/Formula/imagemagick.rb

.
.
.


$ git checkout be8e0ff imagemagick.rb

$ brew install imagemagick

さいごに

これで、問題なく旧バージョンのライブラリがインストールできた。 ここが綺麗にまとまってるので良い感じ。