How to load homebrew on Fish shell? #4412
-
Output of
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
It should suggest it already in the install command. But if it doesn't, it's exactly the same as for bash, except you need to do |
Beta Was this translation helpful? Give feedback.
-
Which OS are you trying to install Homebrew on? On Intel Macs, the brew executable got symlinked into On newer M1 Macs, I ended up adding the following to my eval "$(/opt/homebrew/bin/brew shellenv)" The install script suggests using It'd probably make sense to add information about |
Beta Was this translation helpful? Give feedback.
-
The proper shell command for Fish is simply set brewcmd (path filter /opt/homebrew/bin/brew /usr/local/bin/brew)[1]
and $brewcmd shellenv | source |
Beta Was this translation helpful? Give feedback.
-
This is what I have been using without problems for months after asking this question: if test -d /home/linuxbrew/.linuxbrew
# Homebrew is installed on Linux
set -gx HOMEBREW_PREFIX "/home/linuxbrew/.linuxbrew"
set -gx HOMEBREW_CELLAR "/home/linuxbrew/.linuxbrew/Cellar"
set -gx HOMEBREW_REPOSITORY "/home/linuxbrew/.linuxbrew/Homebrew"
set -gx PATH "/home/linuxbrew/.linuxbrew/bin" "/home/linuxbrew/.linuxbrew/sbin" $PATH
set -q MANPATH; or set MANPATH ''
set -gx MANPATH "/home/linuxbrew/.linuxbrew/share/man" $MANPATH
set -q INFOPATH; or set INFOPATH ''
set -gx INFOPATH "/home/linuxbrew/.linuxbrew/share/info" $INFOPATH
# Homebrew asked for this in order to `brew upgrade`
set -gx HOMEBREW_GITHUB_API_TOKEN {api token goes here, don't remember where that's created}
else if test -d /opt/homebrew
# Homebrew is installed on MacOS
/opt/homebrew/bin/brew shellenv | source
end
end |
Beta Was this translation helpful? Give feedback.
-
This might be a little bit better. if test -d /home/linuxbrew/.linuxbrew # Linux
set -gx HOMEBREW_PREFIX "/home/linuxbrew/.linuxbrew"
set -gx HOMEBREW_CELLAR "$HOMEBREW_PREFIX/Cellar"
set -gx HOMEBREW_REPOSITORY "$HOMEBREW_PREFIX/Homebrew"
else if test -d /opt/homebrew # MacOS
set -gx HOMEBREW_PREFIX "/opt/homebrew"
set -gx HOMEBREW_CELLAR "$HOMEBREW_PREFIX/Cellar"
set -gx HOMEBREW_REPOSITORY "$HOMEBREW_PREFIX/homebrew"
end
fish_add_path -gP "$HOMEBREW_PREFIX/bin" "$HOMEBREW_PREFIX/sbin";
! set -q MANPATH; and set MANPATH ''; set -gx MANPATH "$HOMEBREW_PREFIX/share/man" $MANPATH;
! set -q INFOPATH; and set INFOPATH ''; set -gx INFOPATH "$HOMEBREW_PREFIX/share/info" $INFOPATH; |
Beta Was this translation helpful? Give feedback.
This is what I have been using without problems for months after asking this question: