Homebrew install specific version of formula?

后端 未结 27 2491
渐次进展
渐次进展 2020-11-21 11:21

How do I install a specific version of a formula in homebrew? For example, postgresql-8.4.4 instead of the latest 9.0.

27条回答
  •  失恋的感觉
    2020-11-21 12:24

    None of these really worked for my case (Python), so I'll add my 2 cents:

    cd `brew --prefix`
    git log Library/Formula/python.rb
    

    Output looks like this:

    commit 9ff2d8ca791ed1bd149fb8be063db0ed6a67a6de
    Author: Dominyk Tiller 
    Date:   Thu Jun 30 17:42:18 2016 +0100
    
        python: clarify pour_bottle reason
    
    commit cb3b29b824a264895434214e191d0d7ef4d51c85
    Author: BrewTestBot 
    Date:   Wed Jun 29 14:18:40 2016 +0100
    
        python: update 2.7.12 bottle.
    
    commit 45bb1e220341894bbb7de6fd3f6df20987dc14f0
    Author: Rakesh 
    Date:   Wed Jun 29 10:02:26 2016 +0530
    
        python 2.7.12
    
        Closes #2452.
    
        Signed-off-by: Tim D. Smith 
    
    commit cf5da0547cd261f79d69e7ff62fdfbd2c2d646e9
    Author: BrewTestBot 
    Date:   Fri Jun 17 20:14:36 2016 +0100
    
        python: update 2.7.11 bottle.
    
    ...
    

    I want version 2.7.11 so my hash is cf5da0547cd261f79d69e7ff62fdfbd2c2d646e9 (or cf5da05 for short). Next, I check out that version and install the formula python:

    git checkout cf5da05
    brew install python
    

    Finally, clean up:

    git checkout master
    

提交回复
热议问题