brew install hadoop installing 2.8.1 version. But needed 2.7.4 version - hadoop

I have Homebrew 1.3.1
I want to install hadoop 2.7 but brew is installing hadoop 2.8 version.
I tried
brew versions, which is not available anymore.
brew tap homebrew/version, which is now deprecated.
In previous brew version, we were able to use brew tap homebrew/boneyard and then brew versions work. But, now even from homebrew/boneyard the versions command is removed.
Would we good to know the direct command for homebrew to run and install hadoop 2.7.4

(#bfontaine its not a duplicate question as that answer is 6 years ago and no longer works)
You can try running
brew list --versions hadoop
to see if you have previous versions and you can switch to it by running
brew switch hadoop 2.7.4
There is
brew install <package_name>#<version>
Unfortunately it seems hadoop and many other packages haven't set it up to be possible to download the older version and I haven't found out a way to do it.

As I am writing this, there is a version 2.7.7 of hadoop here: https://dist.apache.org/repos/dist/release/hadoop/common/
You can use 'brew edit hadoop' to refer to that version directly, and then run 'brew install hadoop'.

Related

Need help installing Ruby 2.7.2 on Mac

I'm trying to install Ruby version 2.7.2 on my Mac (latest OS with all updates) and did the following
brew update
brew upgrade rbenv ruby-build
and then
rbenv install 2.7.2
ruby-build: definition not found: 2.7.2
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
brew update && brew upgrade ruby-build
So I tried following the instructions above and get this
brew update && brew upgrade ruby-build
Already up-to-date.
Warning: ruby-build 20200926 already installed
You need to install the latest ruby-build
$ brew unlink ruby-build # remove STABLE version
$ brew install --HEAD ruby-build
$ rbenv install -l | grep '2.7.2'
2.7.2
Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all' to show all local versions.
The answer from #andrei-kovrov is correct but, alternatively, you can wait until this PR gets merged:
https://github.com/Homebrew/homebrew-core/pull/62096
Btw, this answer will not age well so, for reference, this is where the formulae are staged before they get released:
https://github.com/Homebrew/homebrew-core/pulls
It might be an issue reading the correct version of ruby based on the path that is specified. If you already have another version of ruby installed the path might not be updated to look for a newer version.
This article has a lot of really great information on how to set up ruby on a mac:
https://stackify.com/install-ruby-on-your-mac-everything-you-need-to-get-going/

When brew does not have latest package version

How do I force brew to install latest version of neovim (ver 0.5.0) when brew's formula only has 0.4.3?
I have tried:
brew update
brew upgrade neovim
And it says: Warning: neovim 0.4.3 already installed
I went brew's git repo and checked on neovim formula. Brew has neovim's 0.4.3, not 0.5.0. So brew update/upgrade is not going to help. https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb
I'm thinking of just downloading neovim from neovim repo and installing it manually, but I'm afraid I'll have to manage updates and dependencies if I do this manual install.
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz
tar xzf nvim-macos.tar.gz
./nvim-osx64/bin/nvim
What should I do?
I fixed this with the following steps:
1) Unlink old neovim version:
brew unlink neovim ... and 2)
Install pointing to head:
brew install --HEAD neovim
... This installed neovim 0.5.0.
According to the brew doc, brew install --HEAD will install the master branch of the package. For neovim, it means that the latest version of neovim will be built for you, which may not be stable enough or even compile.
I suggest you install the nightly binary version of neovim. The best way to get the nightly version is to download from the binary release. No dependency is required to install if you download the binary release.
If you don't want to do this manually, you can write a bash script to automate this.

Switching Ruby versions using homebrew

One of the projects that I've been working has a dependency on ruby#2.3.
I'm using a Mac and the version of Ruby that I used for other projects is the 2.5.
I want to temporarily switch from 2.5 to 2.3 using brew. I don't want to use neither rbenv nor rvm.
1. I've installed the 2.3.7 version, using brew:
bf-old> brew install ruby#2.3
Warning: ruby#2.3 2.3.7 is already installed and up-to-date
To reinstall 2.3.7, run `brew reinstall ruby#2.3
2. I'm trying to switch to it, but it's not working:
bf-old> brew switch 2.3.7
Error: 2.3.7 not found in the Cellar.
What can I do about this?
Check if both the ruby versions are installed.
If both are installed, then try this:
brew unlink ruby#2.5 && brew link --force --overwrite ruby#2.3

How to install specific version of maven in mac using brew command

I want to install specific version (3.0.5) of maven in my using brew command. I tried the following command which is failed with Error: No available formula with the name "3.0.5"
brew install maven 3.0.5
Any ideas?
brew search maven
lists all maven versions as below
maven maven-completion maven-shell maven#3.0 maven#3.1 maven#3.2 ✔ maven#3.3
brew install maven#3.0
Installs maven 3.0.5 on my mac.
brew install https://raw.github.com/Homebrew/homebrew-versions/master/maven30.rb
it will then use a different Homebrew's formular which will give you the maven 3.0.5 instead
I tried this last on my Mac and it works installing the 3.0.5!
If none works and you can use similar version try the below:
brew install maven30
What OS do you have? On OS X 10.9 you should use brew install maven30 since maven 3.1.1 seems to be buggy.
By the way:
Using Homebrew:
you#host:~$ brew install maven will install Maven 3.3.1 (3/24/15)
you#host:~$ brew install maven30 will install Maven 3.0 which should be
better
If you got a 404 error, try doing a brew update just before.
If always nothing, try to recover the installation:
cd ~/Documents
mkdir BrewRecovery
cd BrewRecovery
curl -OL https://gist.githubusercontent.com/ilovezfs/21a741a78927a17b9ad1/raw/fef5866ccd51f07a9635fcb1096e8df0479af01b/Brewfile-deanchester.brewfile
md5 Brewfile-deanchester.brewfile
In general,
brew is unable to install any specific version such as 3.8.1
as it only gives few versions as the available options.
The only way then to install would be do it manually.
Also don't forget to update Path variable in your mac.
If you run brew install maven, the latest stable version would be installed.
If you want to install the previous versions you can run
brew install maven#versionNumber where versionNumber is your desired version.
Not all versions are available here in,
Also you may try hitting the website with the required version and download the file its available
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/.
where you may substitute 3.6.1 with the version you want to run.

Missing formulas in broken homebrew

After doing a Ctrol+C on a 'brew update' command, can't see all available formulas (searching with brew search command, E.g any php package)
I've tried with brew doctor and cleanup commands without any luck.
How can I fix this without uninstalling brew and all its programs?
I'm wondering about this as well. I switched to an older version of scala, now the formula is missing and I can't install the latest version. I'm going to uninstall and reinstall homebrew for a quickfix for now.

Resources