Skip to content

Instantly share code, notes, and snippets.

@SupaMic
Created February 26, 2025 11:55
Show Gist options
  • Save SupaMic/a1b94551d90cc7748296510c1f157f83 to your computer and use it in GitHub Desktop.
Save SupaMic/a1b94551d90cc7748296510c1f157f83 to your computer and use it in GitHub Desktop.
Instructions for installing the latest Elixir and Erlang using asdf version manager

Check if asdf is installed, if not install

which asdf || echo "asdf not found"
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1 && echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc && echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc && source ~/.bashrc && asdf --version

Add the Elixir and Erlang plugins

asdf plugin add erlang && asdf plugin add elixir

List the last 8 versions of each

asdf list-all erlang | grep -E '^27' | tail -5 && echo "---" && asdf list-all elixir | grep -E '^1\.18' | tail -8

install the Erlang dependencies (Debian)

apt-get update && apt-get install -y build-essential autoconf m4 libncurses5-dev libssl-dev libwxgtk3.2-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils default-jdk

install Erlang and wait for build where <erlang-version> like '27.4.2'

asdf install erlang <erlang-version>

install Elixir build with matching Erlang OTP major version number like '1.18.2-otp-27'

asdf install elixir <elixir-version>-otp-<erlang-major-version>

set the asdf global versions for Erlang and Elixir:

asdf global erlang 27.2.4 && asdf global elixir 1.18.2-otp-27 && asdf current

Verify

erl -version && elixir --version

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