Skip to content

Commit a7cdcfe

Browse files
committed
feat(install): brew install old version package
1 parent 1472bb3 commit a7cdcfe

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Install/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,23 @@ brew install mysql-client
5050
brew install libpq
5151
brew tap ringohub/redis-cli; brew install redis-cli
5252
```
53-
安装历史版本
53+
安装不同版本包(例如python的不同版本)
5454
```bash
5555
brew search {$name}
5656
brew install {$name}@{$version}
5757
```
5858

59+
安装指定包的历史版本(brew 默认只能安装最新版本包)
60+
```bash
61+
# 举例:安装openjdk@11的11.0.27版本(老版本),最新版是11.0.28
62+
# 1.去https://github.com/Homebrew/homebrew-core/tree/main/Formula找到历史版本包,下载rb文件(可通过git history找到)
63+
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/81e8cf683be640a8da5dc4f3da40e3298d947dbe/Formula/o/openjdk@11.rb
64+
# 2.因brew不允许直接从本地文件安装,需要创建插件仓库后安装
65+
brew tap-new miaoyc/oldjdk
66+
cp openjdk@11.rb /opt/homebrew/Library/Taps/miaoyc/homebrew-oldjdk/Formula
67+
brew install miaoyc/oldjdk/openjdk@11
68+
```
69+
5970
### Docker
6071
[Docker Desktop for Mac](https://docs.docker.com/desktop/install/mac-install/)
6172

0 commit comments

Comments
 (0)