multiple side-by-side versions with Homebrew?

前端 未结 3 548
囚心锁ツ
囚心锁ツ 2021-02-03 17:28

Is it possible to install multiple versions side-by-side with Homebrew?

I find myself in a situation needing sbt-0.7.x, sbt-0.10.x and sbt-0.11.0. I\'ve installed both s

相关标签:
3条回答
  • 2021-02-03 17:53

    To easily switch between versions of formulae, you can use:

    brew switch <formula> <version>
    

    For example:

    brew switch gradle 3.2.1
    

    To list which versions you have installed try:

    brew list --versions
    

    or:

    brew list <formula> --versions
    

    If you want to get rid of older versions, just use:

    brew cleanup
    
    0 讨论(0)
  • 2021-02-03 17:53

    As of Homebrew 2.0.0, it would remove old packages automatically when brew upgrade is called. (https://brew.sh/2019/02/02/homebrew-2.0.0/). To opt-out of this behavior, set the environment variable: export HOMEBREW_NO_INSTALL_CLEANUP=1

    0 讨论(0)
  • 2021-02-03 17:54

    Yeah. When you install a new version of a package, it keeps the old one. The symlinks in /usr/local/bin or wherever point to the latest version, but you can still call the binaries (or link to the libraries) in the older version.

    brew list to see what's installed. You can look in package directories to see all the versions; or call brew list --versions to see all packages and all versions.

    0 讨论(0)
提交回复
热议问题