Skip to content

Instantly share code, notes, and snippets.

@giseongeom
Last active August 3, 2022 08:21
Show Gist options
  • Save giseongeom/25da41fca047d9bfc72cf8ef8717ab55 to your computer and use it in GitHub Desktop.
Save giseongeom/25da41fca047d9bfc72cf8ef8717ab55 to your computer and use it in GitHub Desktop.
Install (Linux) Homebrew non-interactively
#!/usr/bin/env bash
set -e
# Unattended install of homebrew
# https://docs.brew.sh/Installation#unattended-installation
export NONINTERACTIVE=1 && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Adding Homebrew to your PATH
# https://docs.brew.sh/Homebrew-on-Linux
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile
#
echo "linuxbrew Installation is Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment