Alexander Zeitler

Alexander Zeitler

Installing the latest Elixir and Erlang versions on Xubuntu 22.04

Published on Sunday, April 16, 2023

Photo by Mika Baumeister on Unsplash

Elixir artwork

After dabbling around with some Elixir courses I wanted to dig into the event sourcing sample named "franklin" by Mike Zornek.

Mike provides a README, so let's just run mix setup and see what happens:

** (Mix) You're trying to run :franklin on Elixir v1.12.2 but it has declared in its mix.exs file it supports only Elixir ~> 1.14.0

To be honest, I didn't care exactly about which versions of Elixir and Erlang I had installed using apt-get install erlang elixir and IEx experiments did work fine so far.

Ok, the latest stable versions seem to be Erlang 25.3 and Elixir 1.14.4.

Maybe mix was right...

After looking around at Elixir Forum, several people suggested using asdf which I've installed already (but I'll explain it from scratch anyway).

So, here we go - first uninstalling the old versions:

apt remove erlang elixir 

Then install asdf:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf

As I'm using oh-my-zsh / zsh, I've also enabled the asdf plugin in ~/.zshrc:

plugins=(
  asdf
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

Next, I installed the erlang and elixir plugins for asdf:

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git

Then, some build dependencies are required:

sudo apt install libssl-dev automake autoconf libncurses5-dev

And finally, install Erlang:

export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
asdf install erlang 25.3

asdf_25.3 is not a kerl-managed Erlang/OTP installation
The asdf_25.3 build has been deleted
Extracting source code
Building Erlang/OTP 25.3 (asdf_25.3), please wait...
APPLICATIONS DISABLED (See: /home/alexzeitler/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
* jinterface     : Java compiler disabled by user
* odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /home/alexzeitler/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
* wx             : No OpenGL headers found, wx will NOT be usable
* No GLU headers found, wx will NOT be usable
* wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
*         wxWidgets must be installed on your system.
*         Please check that wx-config is in path, the directory
*         where wxWidgets libraries are installed (returned by
*         'wx-config --libs' or 'wx-config --static --libs' command)
*         is in LD_LIBRARY_PATH or equivalent variable and
*         wxWidgets version is 3.0.2 or above.

DOCUMENTATION INFORMATION (See: /home/alexzeitler/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
* documentation  : 
*                  xsltproc is missing.
*                  fop is missing.
*                  xmllint is missing.
*                  The documentation cannot be built.

Erlang/OTP 25.3 (asdf_25.3) has been successfully built
Cleaning up compilation products for 
Cleaned up compilation products for  under /home/alexzeitler/.asdf/plugins/erlang/kerl-home/builds

And Elixir:

asdf install elixir 1.14.4-otp-25 
==> Checking whether specified Elixir release exists...
==> Downloading 1.14.4-otp-25 to /home/alexzeitler/.asdf/downloads/elixir/1.14.4-otp-25/elixir-precompiled-1.14.4-otp-25.zip
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 6516k  100 6516k    0     0  12.2M      0 --:--:-- --:--:-- --:--:-- 12.2M
==> Copying release into place

franklin on  main [?] is 📦 v0.1.0 via 💧 v1.14.4 (OTP 25) 
❯ elixir --version                                               
Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.14.4 (compiled with Erlang/OTP 25)

Set the default versions:

asdf global elixir 1.14.4-otp-25
version 1.14.4 is not installed for elixir

asdf global erlang 25.3

Result:

Erlang/OTP 25 [erts-13.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.14.4 (compiled with Erlang/OTP 25)

Looks good and seems to work - however I may have done it wrong. If so, please let me know.

What are your thoughts about "Installing the latest Elixir and Erlang versions on Xubuntu 22.04"?
Drop me a line - I'm looking forward to your feedback! email
Imprint | Privacy