Homebrew install specific version of formula?

后端 未结 27 2633
渐次进展
渐次进展 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:02

    Update on the Library/Formula/postgresql.rb line 8 to

    http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.6/postgresql-8.4.6.tar.bz2
    

    And MD5 on line 9 to

    fcc3daaf2292fa6bf1185ec45e512db6
    

    Save and exit.

    brew install postgres
    initdb /usr/local/var/postgres
    

    Now in this stage you might face the postgresql could not create shared memory segment error, to work around that update the /etc/sysctl.conf like this:

    kern.sysv.shmall=65536
    kern.sysv.shmmax=16777216
    

    Try initdb /usr/local/var/postgres again, and it should run smooth.

    To run postgresql on start

    launchctl load -w /usr/local/Cellar/postgresql/8.4.6/org.postgresql.postgres.plist
    

    Hope that helps :)

提交回复
热议问题