Install Homebrew on Linux for non-sudo package management

Homebrew is for Linux and MacOS, allowing install of the latest compilers and other packages without sudo.

Use the Homebrew install script without sudo.

Install desired packages. Gfortran comes with

brew install gcc

Generally the latest compilers are available from Homebrew for Linux and MacOS.

Homebrew environment variables

Instead of putting the Homebrew variables into ~/.bashrc, consider putting them into ~/, where you can activate them when needed, instead of constantly being active. Either choice is fine of course.

Create ~/ containing:



Anytime you want to use Linuxbrew, type

. ~/

Upon closing the terminal, the configuration falls back to default (non-Homebrew)