-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linuxbrew install steps don't add brew to PATH #6033
Comments
This probably explains #5872 |
@Homebrew/linux Two options here:
|
I feel number 2) modify .bashrc is preferred. That's because .bashrc is evaluated in .bash_profile anyway, and avoids someone having to restart their desktop. |
Actually there is something in the install instructions: I think these are more up-to-date. We should align the documentation in https://github.com/Homebrew/brew/blob/deffe8d403ff092c04b92094635eb8006c8f3bdf/docs/Homebrew-on-Linux.md to reflect that. |
These instructions fix the current shell. On Ubuntu, if the user opens a new shell, that shell will not work (will not have Homebrew in |
For the time being there's a straight-up factual inaccuracy in the documentation...
This is not true, brew will not be available after placing these commands in .bash_profile. I am surprised you prefer to put brew-specific shell config into .profile or .bash_profile and not .bashrc for Ubuntu/Debian/Others, which would eliminate the issues. However, if you're going with this choice, it should be stated that a full restart of the desktop is needed before brew will be available. Currently your new Ubuntu and Debian users will be hitting a brick wall following these instructions, and will assume they have made an error or have something shonky about their config given the clear statement that these steps should make brew available when they just don't. |
Following these instructions, which are printed by the installer, will add Homebrew to the |
Good point. Still unsure why the decision has been to add to .bash_profile but I was factually wrong for the shell which the user actually ran the install in. You are right, the proper environment will have been set up for that shell session alone. The choice of .bash_profile instead of .bashrc means it won't be available in another shell until the desktop is restarted on Ubuntu/Debian. To a non-specialist user it may seem the brew installation has disappeared when running from a different shell or if they close and reopen a terminal without memorising the eval step. To my mind is a POLA violation https://en.wikipedia.org/wiki/Principle_of_least_astonishment and is most likely responsible for #5872 but you know much more about the constraints of installing across multiple target platforms so you probably have good reason. Happy to close. |
@Homebrew/linux Two options here:
|
Later checks don't apply as the path to
brew
is broken when following the install instructions.What you were trying to do (and why)
Follow the install instructions at https://github.com/Homebrew/brew/blob/master/docs/Homebrew-on-Linux.md to get brew installed and on my path on an Ubuntu Bionic laptop. Test: interactively launching a GUI terminal such as LXTerminal or Gnome Terminal should be able to run a
brew
binary.What happened (include command output)
Typing
brew
from a new terminal gets me...Command output
What you expected to happen
Homebrew would be found in my PATH from a newly-launched LXTerminal after following the shell profile configuration instructions.
Step-by-step reproduction instructions (by running
brew
commands)For Ubuntu/Debian I believe the instructions should be to add a command like
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
to
~/.bashrc
not~/.bash_profile
or~/.profile
See e.g. https://what.thedailywtf.com/topic/19866/bash_profile-vs-bashrc-ubuntuSee https://github.com/Homebrew/brew/blob/deffe8d403ff092c04b92094635eb8006c8f3bdf/docs/Homebrew-on-Linux.md for the currently broken instructions which reference only .bash_profile for Ubuntu/Debian and this approach would only work for the case of relaunching in a login shell.
The text was updated successfully, but these errors were encountered: