Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
440 views
in Technique[技术] by (71.8m points)

homebrew - how to install older versions

I'm trying to install memcached with older versions (ex: 1.4.5) but I'm not sure how to do it.

brew install memcached installs the latest.

I also tried brew install memecached1.4.5 but it didn't work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Usually, you can check if multiple versions are available and you can specify the version with @. e.g. brew install package@2.8

$ brew info memcached

memcached: stable 1.4.24
High performance, distributed memory object caching system
https://memcached.org/
Conflicts with:
  mysql-cluster (because both install `bin/memcached`)
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/memcached.rb
...

If is not available the version you want you can go to the repo, and check the history

cd "$(brew --repo homebrew/core)"
git log master -- Formula/memcached.rb

Then you can find the commit you are looking for

commit 5ec463decefeaab3d1825b923ad2dbee73ffc6dc
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Fri Apr 9 21:19:48 2010 -0700

    Update memcached to 1.4.5

Checkout that version and install:

cd "$(brew --repo homebrew/core)" && git checkout 5ec463decefeaab3d1825b923ad2dbee73ffc6dc
HOMEBREW_NO_AUTO_UPDATE=1 brew install memcached

Once you get the version installed, you can bring brew to its latest version with:

git checkout master

and, that's it!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...