Install Homebrew on WSL2
Install HomeBrew on WSL2
- Open Ubuntu WSL App
- Run Update command
1
$ sudo apt update
- Install tool require to setup Brew
1
$ sudo apt-get install build-essential curl file git
- Command to Install HomeBrew on WSL Windows 10
1
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
- Add HomeBrew to your system PATH
1 2 3 4
$ test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) $ test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) $ test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile $ echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
- Use Brew on WSL
1 2
$ brew -v $ brew update
References:
This post is licensed under CC BY 4.0 by the author.