brew 安装多版本
例子,当前 gradle 5.2.1 ,想将 4.10.2 装上,找到 formula 的 git 目录,切到对应 4.10.2 的 commit,安装,安装完之后再切回 master
$ brew list gradle --versions gradle 5.2.1 $ cd "$(brew --repo homebrew/core)" $ pwd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core $ git log master -- Formula/gradle.rb ... commit 01e0511df2c37b052a9659797f3c09df3f20d533 Author: Jerome LapostoletDate: Thu Sep 20 08:51:53 2018 +0100 gradle 4.10.2 ... $ git checkout 01e0511df2c37b052a9659797f3c09df3f20d533 Note: checking out '01e0511df2c37b052a9659797f3c09df3f20d533'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b $ brew list gradle --versions gradle 5.2.1 4.10.2HEAD is now at 01e0511df2 gradle 4.10.2 $ HOMEBREW_NO_AUTO_UPDATE=1 brew install gradle Error: gradle 5.2.1 is already installed To install 4.10.2, first run `brew unlink gradle`. $ HOMEBREW_NO_AUTO_UPDATE=1 brew unlink gradle Unlinking /usr/local/Cellar/gradle/5.2.1... 1 symlinks removed $ HOMEBREW_NO_AUTO_UPDATE=1 brew install gradle ==> Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip ==> Downloading from https://downloads.gradle.org/distributions/gradle-4.10.2-all.zip ######################################################################## 100.0% 🍺 /usr/local/Cellar/gradle/4.10.2: 203 files, 83.7MB, built in 5 minutes 56 seconds $ git checkout master
之后可以用 brew swith gradle x.x.x 在不同版本之间切换
helm 安装 v2.9.1 版本
https://medium.com/@nehaguptag/installing-older-version-of-helm-downgrading-helm-8f3240592202 wget https://raw.githubusercontent.com/Homebrew/homebrew-core/78d64252f30a12b6f4b3ce29686ab5e262eea812/Formula/kubernetes-helm.rb brew install kubernetes-helm.rb
查看已经安装的包
brew list
选择要清理的包
brew uninstall mariadb
整体清理
brew update && brew upgrade && brew cleanup ==> This operation has freed approximately 427.8M of disk space.
brew cask cleanup
https://brew.sh/ 搜索软件和版本
检查当前 brew 的配置情况
brew doctor master 187b0c8b0d Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Some installed kegs have no formulae! This means they were either deleted or installed with `brew diy`. You should find replacements for the following formulae: python@2 ab tuntap unrar sshpass php54 Warning: Some installed formulae are deprecated or disabled. You should find replacements for the following formulae: dep docker-machine [email protected] sshfs Warning: Unbrewed dylibs were found in /usr/local/lib. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected dylibs: /usr/local/lib/libD4P11_ICBC.dylib /usr/local/lib/libD4PinPad_ICBC.dylib /usr/local/lib/libD4Token_ICBC.dylib /usr/local/lib/libshuttle_p11v220.1.0.0.dylib Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on those kegs to fail to run properly once built. Run `brew link` on these: tree pandoc docker python@2 docker-machine ab markdown tuntap aria2 geoip unixodbc unrar gd wireshark php54 Warning: Some taps are not on the default git origin branch and may not receive updates. If this is a surprise to you, check out the default branch with: git -C $(brew --repo homebrew/core) checkout master Warning: Homebrew's "sbin" was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting your PATH for example like so: echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
参考:
https://www.cnblogs.com/BlackStorm/p/homebrew-install-old-versions-take-node-for-example.html
Leave a Reply