Skip to content

Instantly share code, notes, and snippets.

@bugcy013
Created April 18, 2022 16:37
Show Gist options
  • Save bugcy013/29bf4af654a8313cfb430ff4f8a88382 to your computer and use it in GitHub Desktop.
Save bugcy013/29bf4af654a8313cfb430ff4f8a88382 to your computer and use it in GitHub Desktop.
MacOS Homebrew without sudo

Homebrew is a popular framework for quickly installing development tools on MacOS, including Gfortran. MacOS cloud services such as MacInCloud may say they provide Homebrew, but you may not be able to install packages without a sudo/admin account. To install Homebrew without sudo/admin in the user home directory for cloud or physical Mac hardware, follow these steps:

mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

Edit ~/.profile to include

export PATH=$HOME/homebrew/bin:$PATH

Open a new Terminal to use Homebrew.

If one truly doesn’t have sudo/admin access as typical with a managed (less-expensive) cloud MacOS plan, and if XCode is not the appropriate version, GCC may compile from source, which can take about an hour on a modern quad-core Mac. This may occur when doing

brew install gcc

Reference: Homebrew without sudo script

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