Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.66k stars 237 forks source link

Everytime I want to use linuxbrew I should enter some commands! <don't know why!> #711

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hey there. I installed linuxbrew on my F28 successfully via the instruction in http://linuxbrew.sh/ Let's be more clear! First of all I entered sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" as the instruction in the site said, once the installation completed successfully, the output of command also wanted to do some other works... First; sudo yum groupinstall 'Development Tools' Second;

- Add Linuxbrew to your ~/.profile by running
    echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >>~/.profile
    echo 'export MANPATH="/home/linuxbrew/.linuxbrew/share/man:$MANPATH"' >>~/.profile
    echo 'export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:$INFOPATH"' >>~/.profile

also I added these lines to .bash_profile ('cause I'm using Fedora!) Third;

- Add Linuxbrew to your PATH
    PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"

and I did it in ~/.bash_profile and ~/.profile Forth;

- We recommend that you install GCC by running:
    brew install gcc

but the matter is right there! In bash and fish (I'm using fish as default shell) when I enter brew STH, it will reply fish/bash: brew: command not found... on the other hand I found these command in the site:

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

then I entered this commands and after that brew is available in both fish and bash!!! and then I tried to add these lines to my .bash_profile and .profile but no luck! I mean everytime I want to use brew, first I need to enter these commands! So the matter is: Is there anyway that I can set brew available for fish and bash in defaults!? Regards.

sjackman commented 6 years ago

Hi, Mohammad. I'm not familiar with the fish shell, so I can't comment there. For bash, log out and log back in, and it should hopefully start working. If you like in either of the files ~/.bash_profile or ~/.profile you should see at the end the line PATH="/home/linuxbrew/.linuxbrew/bin:$PATH".

ghost commented 6 years ago

@sjackman Wooow! It's now working with both fish and bash without any configurations! I didn't know that and it seems this step (restart session after installing) not mentioned in installation script or wiki! Thanks for your respond and also this great work (linuxbrew). Regards.

P S. Can I make a pull request to https://github.com/Linuxbrew/install/blob/master/install for mention this (restart the session) to installation script?

sjackman commented 6 years ago

Sure. Thanks. I'd suggest wording like…

After modifying your shell profile, you may need to logout and back in, if the brew command is not found, to make this change take effect.

ghost commented 6 years ago

Now the pull request merged :D