Skip to content

Instantly share code, notes, and snippets.

@shahali007
Last active August 15, 2024 06:10
Show Gist options
  • Select an option

  • Save shahali007/1fe50982af4a6bc055732565e9940b69 to your computer and use it in GitHub Desktop.

Select an option

Save shahali007/1fe50982af4a6bc055732565e9940b69 to your computer and use it in GitHub Desktop.
Install Homebrew Package Manager on Linux

1. Update software repositories

  sudo apt update

2. Install prerequisite packages (Ignore, if already installed)

  sudo apt install build-essential procps curl file git -ymd

3. Download and execute the brew installer

  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

4. Press enter when prompted to continue

5. Copy homebrew to system path

  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

You’re done! Try installing a package:

  brew install hello

Run hello

  hello

Source: https://docs.brew.sh/Homebrew-on-Linux

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