-
Installing a specific version of software using brew
- contexts
- Method 1: Direct Installation
- Method 2: Installation using historical rb files
- bibliography
Installing a specific version of software using brew
contexts
brew
is a great package management tool for the Mac that makes it easy to download and install all kinds of software, similar to Ubuntu'sapt-get
and theyum
stillbrew
utilizationgit
to manage packages, so the version of the installed packages will be updated as their source repositories are updated
If you need to install an older version of the software, which is relatively troublesome, here's a record of how to do it
Method 1: Direct Installation
Some packages can be installed directly via brew install, such aspython
brew search python@
==> Formulae
[email protected] [email protected] ✔ [email protected]
[email protected] [email protected] ✔ [email protected]
# mounting python 3.10
brew install [email protected]
Method 2: Installation using historical rb files
Use brew info to find the address of its rb file, and then go to GitHub to find the historical version of the rb file
- Download/copy the text locally and install it using this rb file
- Or just install it with the link address of the file
Here's an example of installing hugo 0.136.5
# ferret out hugo text
brew info hugo
==> hugo: stable 0.139.4 (bottled), HEAD
Configurable static site generator
/
Installed
/opt/homebrew/Cellar/hugo/0.136.5 (53 files, 68.8MB) *
Poured from bottle on 2024-12-11 at 23:27:01
From: /Homebrew/homebrew-core/blob/HEAD/Formula/h/
License: Apache-2.0
==> Dependencies
Build: go ✘
==> Options
--HEAD
Install HEAD version
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
==> Analytics
install: 15,963 (30 days), 49,454 (90 days), 203,875 (365 days)
install-on-request: 15,967 (30 days), 49,453 (90 days), 203,857 (365 days)
build-error: 52 (30 days)
call on/Homebrew/homebrew-core/blob/HEAD/Formula/h/
Find the desired version in history and copy the link address
Then just install it locally
# Download the rb file and install it
wget /Homebrew/homebrew-core/HEAD/Formula/h/
brew install . /Homebrew/homebrew-core/HEAD/Formula/h
# Or just use the link
brew install /Homebrew/homebrew-core/HEAD/Formula/h/
bibliography
- 【*】Homebrew install specific version of formula?
- Tools - brew install installs the specified version of software (protobuf for example)
Author of this article: ywang_wnlo
Link to this article: /posts/89785ced/
Copyright: All posts on this blog, unless otherwise stated, use theBY-NC-SA License Agreement. Reprinted with permission