homebrew supports the installation of different versions of a package.
Homebrew install specific version of formula?
But I don't see different versions specified in homebrew formulas.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/bash.rb
Does anybody know how the support of different versions of a package is implemented in homebrew? Thanks.
There is at least three different ways package versions are supported by Homebrew.
1) With brew switch, you can switch back to a version of a package you already installed. For example typing brew switch ansible, I obtain:
ansible installed versions: 2.7.5, 2.7.6
using brew switch ansible 2.7.5, I can switch back to an old version, but this works only for versions that have been already installed.
2) With versioned formulas, you can choose an old version of MySQL with brew install mysql#5.5 or brew install mysql#5.6. This works because there is the corresponding formulas: mysql#5.5.rb and mysql#5.6.rb.
3) You can use the git history to go back to any version of a formula, read this question/answer for details: Install older version of Pandoc (<2) using homebrew
Related
Currently, the default version of python3 installed through homebrew is 3.10.9. However, the default version of ipython depends on python 3.11.1, which is automatically installed with homebrew.
The problem is that if I install a package via pip, it will not be recognized in ipython because of how homebrew manages different python versions.
Is it possible to ensure ipython uses the same version of python as homebrew's default version?
I understand there are other solutions like using pyenv to manage different versions of python, but I am looking for a solution that only requires homebrew.
I have tried the command brew unlink python#3.10, but it removes the python3 symbolic link, which means I have to update the symbolic link manually to point to the desired version.
Thanks!
I am using the latest version (1.8.2) of homebrew and I am trying to downgrade opencv 3.4.3 to 3.4.0.
I followed this answer homebrew install specific version of formula? However, the problem is that even after I brew tap homebrew/boneyard, brew versions opencv still does not work.
How can I make 'brew versions' work for homebrew 1.8.2?
If that does not work, can I manually download and set up opencv 3.4.0 to homebrew?
I have an issue with not being able to use an integral piece of software due to its dependancy and being compiled with a previous version of opencv. When installing new opencv using homebrew brew install opencv I am getting the latest version 3.4. Is there anyway to install a previous version? Edit: On MacOS.
For others with the same problem:
$ brew install opencv#3
See this other answer about installing different versions of homebrew packages.
Homebrew install specific version of formula?
After I installed Homebrew,
Then I try the brew doctor command, there comes warnings:
Could I know the reasons and How to fix it? Could I just ignore these warnings?
The files reported by brew doctor are added by a software (that you manually installed before installing Homebrew) that uses a library for the Tcl/Tk language.
Homebrew also provides a library for Tcl/Tk and the existing files will conflict with those installed by Homebrew if you install a package that requires the Tcl/Tk library.
You don't have to worry for now and, very important, don't try to "fix" anything (especially don't remove files).
What you can do to "fix" it is to find out what program installed those files (it was not installed using the App Store, you installed it manually) and see if Homebrew provides it. If it is a macOS GUI application then Homebrew doesn't provide it (it contains only command line applications, no GUI) but Homebrew Cask might do it.
Use
$ brew search app
or
$ brew cask search app
If you are lucky and you find it and you are pleased with the version provided by Homebrew then you can uninstall the application using the uninstaller it hopefully provides then reinstall it using Homebrew (or Homebrew Cask).
You can run brew doctor between uninstall and reinstall to make sure the uninstaller removed all the files listed in the output of brew doctor now.
As written at the beginning of brew doctor's output, you can safely ignore these warnings if everything you use Homebrew for works fine.
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 sbt-0.7.7 and sbt-0.10.1 manually at the moment to work around the issue (with sbt-0.11.0 being the latest 'sbt' from Homebrew).
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.
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
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