I am installing properly Homebrew in my ubuntu 22.04 and everything is fine brew doctor, brew --version everything is running properly. But everytime I am rebooting my system, the homebrew is getting uninstalled I dont know why this is happening. Please someone suggest a solution
1 Answer
Homebrew does not uninstall itself. Your issue is probably the following:
$ brew --version
bash: brew: command not found
You can verify that it still exists as follows:
$ /home/linuxbrew/.linuxbrew/bin/brew --version
Homebrew 4.1.1
You can run brew
without writing the full path by adding "$(brew --prefix)"/bin
(/home/linuxbrew/.linuxbrew/bin/
) in PATH
. You can do so by running the eval
command:
$ brew --version
bash: brew: command not found
$ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
$ brew --version
Homebrew 4.1.1
The eval
command can be found under "Next steps" when running the install script. If you are using bash
, you may want to add the command to your .bashrc
(or .bash_profile
for login shells):
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> .bashrc
Related:
StackOverflow: Installing Homebrew on macOS
Homebrew (discussions): "brew: command not found" after installation 🤔 #775