DEV Community

Cover image for How to install Elixir in Manjaro Linux
Víctor Adrián
Víctor Adrián

Posted on • Originally published at lobotuerto.com on

How to install Elixir in Manjaro Linux


You can check the latest updated version of this article at lobotuerto's notes - How to install Elixir in Manjaro Linux.


Installation process

I really like version managers for my dev languages.

I’ve been using asdf for installing Erlang and Elixir with OTP support.

Let’s start!

Clone the GitHub repository:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.2
Enter fullscreen mode Exit fullscreen mode

Add some lines to your .bashrc file:

echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Make changes to .bashrc effective or just close and open your terminal:

exec $SHELL
Enter fullscreen mode Exit fullscreen mode

Finally install Erlang and Elixir:

asdf plugin-add erlang
asdf list-all erlang
asdf install erlang 20.2.4
asdf global erlang 20.2.4

asdf plugin-add elixir
asdf list-all elixir
asdf install elixir 1.6.2-otp-20
asdf global elixir 1.6.2-otp-20
Enter fullscreen mode Exit fullscreen mode

To activate iex REPL history, add this to your .bashrc:

export ERL_AFLAGS="-kernel shell_history enabled"
Enter fullscreen mode Exit fullscreen mode

If you are using this awesome editor (hint: Visual Studio Code ), you should try the ElixirLS extension.

Links

Latest comments (1)

Collapse
 
itachiuchiha profile image
Itachi Uchiha

Thanks. This really helped me.