Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

homebrew - how to install older versions

Tags:

homebrew

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.

like image 758
Henry Dang Avatar asked Aug 28 '16 03:08

Henry Dang


People also ask

How do I download a specific version of brew?

If you can't use the web interface, you can clone the repo and do it locally: use git log master -- Formula/PACKAGENAME. rb to get the commit history, check out the correct commit, and then run brew install Formula/PACKAGENAME. rb to install it. I think you need brew unlink before brew install of other version.

How do I install a specific version of Node Mac?

You can run the npm update specific package command with a specific package name to update a specific package. Also, in some cases, to update a package to a specific version, you must use the npm install command with a version number followed by the package name.

How do I find my Swiftlint version?

Command Line USAGE: swiftlint <subcommand> OPTIONS: --version Show the version.


1 Answers

Usually, you can check if multiple versions are available and you can specify the version with @. e.g. brew install [email protected]

$ 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 <[email protected]> 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!

like image 176
Adrian Avatar answered Oct 04 '22 15:10

Adrian