bash: brew: command not found Ubuntu

bash: brew: command not found

Homebrew (“brew”) is a package manager for OSX. Since we are on Ubuntu we will install Linuxbrew instead. This requires Ruby before installing, you cna use this guide to install Ruby. Once Ruby is installed continue with Step 1.

Step 1

Run the following script:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile
echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile

You can also find a raw gist of the script above on Github.

If you are having problems running the script, try running the first command, then after it is finished run the rest of the commands. Once brew is installed, move onto Step 2.

Leave a Comment

Your email address will not be published. Required fields are marked *