Installation was a series of 5 simple steps:
first, install homebrew itself from command in the home page:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
After that, following instructions in this page, and changing ~/.bash_profile
to ~/.profile
as I am using Ubuntu as my wsl distro, i had to give these commands:
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
But now, when I try to run brew, I get command not found
error.
In a wsl environment, brew is installed at location: /home/linuxbrew/.linuxbrew/
which is not part of the path.
So we simply need to add that to path, and it works. I am using zsh as my shell, so I add these lines to my ~/.zshrc
file (in ubuntu file system) :
export BREW_HOME="/home/linuxbrew/.linuxbrew/bin"
export PATH="$PATH:$BREW_HOME"