Skip to content

Instantly share code, notes, and snippets.

@lewis6991
Last active September 1, 2023 08:57
Show Gist options
  • Save lewis6991/69cfb995ca85e36abca5864b4859e822 to your computer and use it in GitHub Desktop.
Save lewis6991/69cfb995ca85e36abca5864b4859e822 to your computer and use it in GitHub Desktop.
Setup linuxbrew on Redhat 7
# This script assumes you have modern versions of gcc, git and curl on your path.
HOMEBREW_PREFIX="$1"
# From https://github.com/Homebrew/discussions/discussions/254
export HOMEBREW_DEVELOPER=1
export HOMEBREW_CURL_PATH="$(which curl)"
export HOMEBREW_GIT_PATH="$(which git)"
# From https://docs.brew.sh/Homebrew-on-Linux#alternative-installation
git clone https://github.com/Homebrew/brew $HOMEBREW_PREFIX
# From https://github.com/Linuxbrew/brew/wiki/Symlink-GCC
ln -s $(which gcc) "$HOMEBREW_PREFIX"/bin/gcc
ln -s $(which g++) "$HOMEBREW_PREFIX"/bin/g++
ln -s $(which gfortran) "$HOMEBREW_PREFIX"/bin/gfortran
"$HOMEBREW_PREFIX"/bin/brew install git
@lewis6991
Copy link
Author

lewis6991 commented Mar 18, 2021

May also need:

rm $HOMEBREW_PREFIX/lib/libgcc_s.so.1
rm $HOMEBREW_PREFIX/lib/libstdc++.so.6
ln -s $HOMEBREW_PREFIX/opt/gcc@5/lib/gcc/5/libgcc_s.so.1 $HOMEBREW_PREFIX/lib
ln -s $HOMEBREW_PREFIX/opt/gcc@5/lib/gcc/5/libstdc++.so.6 $HOMEBREW_PREFIX/lib

https://github.com/Homebrew/linuxbrew-core/issues/22511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment