Homebrew install specific version of formula?

后端 未结 27 2168
渐次进展
渐次进展 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 11:59

    I created a tool to ease the process prescribed in this answer.

    To find a package pkg with version a.b.c, run:

    $ brew-install-specific pkg@a.b.c
    

    This will list commits on the pkg homebrew formula that mention the given version along with their GitHub urls.

    Matching versions:
    1. pkg: update a.b.c bottle.
       https://github.com/Homebrew/homebrew-core/commit/
    2. pkg: release a.b.c-beta
       https://github.com/Homebrew/homebrew-core/commit/
    3. pkg a.b.c
       https://github.com/Homebrew/homebrew-core/commit/
    
    Select index: 
    

    Verify the commit from the given URL, and enter the index of the selected commit.

    Select index: 2
    Run:
      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core//Formula/pkg.rb
    

    Copy and run the given command to install.

提交回复
热议问题