1 min read

Homebrew Elixir

Installing Elixir on bare-bones Debian, using WSL for example, works best using Homebrew. The standard APT packages install out-of-date versions.

Install Homebrew

Homebrew needs Curl and Git.

sudo apt-get update

# Needs Curl and Git; Focal Fossa already installed
sudo apt-get install curl git --fix-missing

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

Homebrew’s Bash install script does not require root privileges. Homebrew’s “doctor” reports missing developer tools; running brew doctor recommends installing gcc though not initially necessary because Homebrew automatically installs the LLVM toolchain as an Elixir dependency.

Set up your Bash profile and load the necessary shell environment variables for the running terminal, as follows.

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Homebrew ready!

Install Elixir

Now you get up-to-date Erlang and Elixir.

brew install elixir

Finally, Elixir’s version reports the latest; as follows at the time of writing.

$ elixir --version
Erlang/OTP 25 [erts-13.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.13.4 (compiled with Erlang/OTP 24)