# Help installing Elixir on Linux Mint

**URL:** <https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708>\
**Category:** Questions\
**Tags:** erlang, troubleshooting\
**Created:** [May 27, 2019, 3:20pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708 "2019-05-27T15:20:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [May 27, 2019, 3:20pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/1 "2019-05-27T15:20:33Z")

</div>

I’m a beginner, using Linux MInt 18.3 Cinnamon. I installed elixir with apt, but it only found version 1.1, and I’d like to use the newest version, but I have been having trouble. From memory here is what happened:

Tried to install elixir 1.8.2 from source. Got error about Erlang (I had version 18).  
Installed Erlang 22. Got an error trying to install Elixir.  
Installed Erlang 20. Got an error installing Elixir about being compiled in a different version of Erlang. optcode 150-something, but used optcode 168.  
Installed Version 21. Same error - only have up to optcode 163, but need up to 168.  
Read some github entry which suggest that an error was fixed after 21.0.  
Installed 21.1. Crashed, at some make file recipe for targe erlang failed.  
Installed 21.2. Crashed, makefile 64: recipe for target erlang failed.

Not sure if its relevant, but I noticed that erlang --version returns command not found: erlang.

Can anyone suggest for me a combination of elixir version and erlang version that should work together? Or help me resolve this problem another way?

I’ve been using Erlang OTP.

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [May 27, 2019, 3:34pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/2 "2019-05-27T15:34:16Z")

</div>

This seems to be quite a lot of trying. Can you please remove all of your installation attempts?

Then it’s probably easiest to switch to Arch Linux 😉 or just use a toolset manager like `asdf-vm`. It will be able to install, run and change appropriate version sets as you specify them per project.

Also in the official documentation there is a compatibility matrix that tells you which version of elixir is known to work with which version of Erlang.

Just remember that the runtime version of Erlang needs to be equal to or greater than the version used for compiling.

---

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [May 27, 2019, 3:35pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/3 "2019-05-27T15:35:41Z")

</div>

[Installing Elixir on Linux (with asdf)](https://elixirgirls.com/install-guides/linux.html)

---

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [May 27, 2019, 3:44pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/4 "2019-05-27T15:44:49Z")

</div>

Thanks for the replies.

I tried asdf as well but was struggling to get it to find the newest version. I hadn’t seen this link so I will try again.

I saw this compatibility table ([Compatibility and deprecations — Elixir v1.20.2](https://hexdocs.pm/elixir/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp)) but I couldn’t get any of these combinations to work. For instance I tried otp 20, 20.1, 20.2, 21.0, 21.1, 21.2 with a few versions of elixir 1.7 and 1.8 and some other combinations.

I saw the errors about unmatching runtime/compile time Erlang versions, so I’ve been careful to recompile elixir after reinstalling a different Erlang version. I keep getting errors like this though:

Loading of /usr/local/lib/erlang/lib/crypto-4.5/ebin/crypto.beam failed: badfile

Makefile:62: recipe for target ‘erlang’ failed

Anyway, thanks again for the replies, I’ll try asdf again now.

---

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [May 27, 2019, 4:13pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/5 "2019-05-27T16:13:34Z")

</div>

@peerreynders I can’t get asdf to work. I added plugin for elixir, installed then tried to use it and got the error:

01:10:27.753 [error] Loading of /usr/local/lib/erlang/lib/compiler-7.4/ebin/compile.beam failed: :badfile

01:10:27.754 [error] beam/beam\_load.c(1878): Error loading module compile:  
This BEAM file was compiled for a later version of the run-time system than 21.  
To fix this, please recompile this module with an 21 compiler.  
(Use of opcode 164; this emulator supports only up to 163.)

---

<div class="post-metadata">

**Author:** ![ConnorRigby](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/connorrigby/32/5964_2.png) [@ConnorRigby](https://forum.elixirforum.com/u/ConnorRigby)\
**Post date:** [May 27, 2019, 4:15pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/6 "2019-05-27T16:15:17Z")

</div>

> [@NobbZ](#):
>
> Then it’s probably easiest to switch to Arch Linux

😆

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [May 27, 2019, 4:16pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/7 "2019-05-27T16:16:49Z")

</div>

Please deinstall all former tries, also make sure that the location containing `asdf`s shims is located before your systems binaries in `PATH`.

---

<div class="post-metadata">

**Author:** ![rcb](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rcb/32/15445_2.png) [@rcb](https://forum.elixirforum.com/u/rcb)\
**Post date:** [May 27, 2019, 6:01pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/8 "2019-05-27T18:01:57Z")

</div>

I had issues installing Elixir on Linux initially too. I ended up using an installer provided on the [Erlang Solutions website](https://www.erlang-solutions.com/resources/download.html), which bundled Erlang and Elixir together. That seemed to be the easiest way to get started (though I intend on trying a version manager such as asdf soon).

Edit: Corrected misunderstood website source.

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [May 27, 2019, 6:32pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/9 "2019-05-27T18:32:02Z")

</div>

This is **not** the Erlang website! This is the website of Erlang solutions, a big supporter of the Erlang ecosystem.

Also even though mint is a derivat of Ubuntu, I’d be careful to use the packages that were originally built for Debian and Ubuntu. Dependencies might not be available on mints repositories natively.

PS: even though it doesn’t sound like this right now, usually I strictly prefer installation from the systems package manager over installation from source. But especially for languages compilers I learnt to love version managers like `asdf`, they really make life easier when one is using them with discipline.

---

<div class="post-metadata">

**Author:** ![rcb](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rcb/32/15445_2.png) [@rcb](https://forum.elixirforum.com/u/rcb)\
**Post date:** [May 27, 2019, 6:36pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/10 "2019-05-27T18:36:33Z")

</div>

My bad on the mix-up. I’ve corrected my post. I agree regarding version managers — I’d love to have a well-designed manager like rvm for Elixir. I’m hoping that asdf is just as user-friendly.

---

<div class="post-metadata">

**Author:** ![alexiss](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/alexiss/32/15139_2.png) [@alexiss](https://forum.elixirforum.com/u/alexiss)\
**Post date:** [May 27, 2019, 7:53pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/11 "2019-05-27T19:53:37Z")

</div>

I’ve Linux Mint 19 with over 10 versions of erlang and elixir installed via asdf without any problems:

```elixir
alexiss@alexiss:/work/home/alexiss$ asdf list erlang
  20.0
  20.1
  20.2.2
  20.2.3
  20.3.1
  20.3.2
  21.0.8
  21.1.1
  21.2.1
  21.3.2
  21.3.6
  21.3.8
  22.0.1
alexiss@alexiss:/work/home/alexiss$ asdf list elixir
  1.5.1
  1.5.2
  1.6.1
  1.6.4
  1.7.2
  1.7.3
  1.7.4
  1.8.1
  1.8.2
alexiss@alexiss:/work/home/alexiss$ 

```

Try to install it step-by-step following links from this [post](https://forum.elixirforum.com/t/runtime-error-while-compiling-phoenix-error-parsing-file-otp-pub-key-hrl-got-error-enoent/22617/11)

Also make sure you complete all [steps for Ubuntu](https://github.com/asdf-vm/asdf-erlang#ubuntu-and-debian) before installing erlang

---

<div class="post-metadata">

**Author:** ![isaac-rstor](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/isaac-rstor/32/13395_2.png) [@isaac-rstor](https://forum.elixirforum.com/u/isaac-rstor)\
**Post date:** [May 27, 2019, 11:56pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/12 "2019-05-27T23:56:26Z")

</div>

if you uninstall everything these incantations should work.

```elixir
#####################################################
# install elixir (only need to do once)
#
# UBUNTU:
#

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb 
sudo dpkg -i erlang-solutions_1.0_all.deb

sudo apt-get update
sudo apt-get install esl-erlang
sudo apt-get install elixir

```

---

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [May 28, 2019, 2:40am UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/13 "2019-05-28T02:40:56Z")

</div>

I’m not confident I can figure out how to uninstall everything, so maybe my best bet is to get asdf working. I followed the instructions on how to do it, and when installing the erlang version it got as far as saying it was missing fop and another tool for building documentation. Usually when I was installing from source this is where the installation ended, but with asdf I waited 5 minutes before killing the process as it seemed like the command would never terminate. I also got stuck on the command

```elixir
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring

```

it said I was waiting for a key for a long time.

---

<div class="post-metadata">

**Author:** ![Cochonours](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cochonours/32/13516_2.png) [@Cochonours](https://forum.elixirforum.com/u/Cochonours)\
**Post date:** [May 28, 2019, 7:26am UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/14 "2019-05-28T07:26:10Z")

</div>

> [@bend](#):
>
> I’m not confident I can figure out how to uninstall everything

That’s why it’s better to always use a package manager. I also fear that something got broken somewhere during one of your attempts, and even if you end up making it work with asdf or others you might continue experiencing weird things down the line. If I were you I would reinstall the OS (no Arch Linux :p), then either use asdf or the deb from erlang solutions (I think that’s what I did when I was on Mint, and also on debian ; it worked well).

---

<div class="post-metadata">

**Author:** ![alexiss](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/alexiss/32/15139_2.png) [@alexiss](https://forum.elixirforum.com/u/alexiss)\
**Post date:** [May 28, 2019, 7:43am UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/15 "2019-05-28T07:43:06Z")

</div>

> [@bend](#):
>
> but with asdf I waited 5 minutes before killing the process

On my machine erlang installation running above 7 minutes - may be you should wait a little longer

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [May 28, 2019, 8:28am UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/16 "2019-05-28T08:28:31Z")

</div>

> [@bend](#):
>
> but with asdf I waited 5 minutes before killing the process as it seemed like the command would never terminate

As far as I remember `asdf` compiles from source but silencing the output. Just wait.

---

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [July 2, 2019, 12:47pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/17 "2019-07-02T12:47:42Z")

</div>

I reinstalled Linux Mint version 19 this time, and was able to get Elixir 1.9 working. I tried apt install elixir, but still I the latest version it could find was 1.3.3. I removed it, and removed erlang-base.

What eventually worked was to install erlang by `apt install erlang-base` and then to download the precompiled elixir 1.9 from the elixir-lang website. (I also tried to compile it myself, but this did not work - there was an error finding something from erlang). I was able to add it my PATH and everything is working smoothly now.

The instructions to install the erlang-solutions .deb file did not work for me - I still only got version 1.3.3 of elixir.

---

<div class="post-metadata">

**Author:** ![NobbZ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/32/27235_2.png) [@NobbZ](https://forum.elixirforum.com/u/NobbZ)\
**Post date:** [July 2, 2019, 12:56pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/18 "2019-07-02T12:56:04Z")

</div>

ESL does not build for Linux Mint, so whatever you install seems to assume a version of ubuntu or debian that di not receive any further updates after 1.3.3. As far as I can tell, it assumes Debian Wheezy, as this in fact did not receive the 1.3.4 update from what I see on the ESL download page.

Please do not install random packages that are not meant for your system.

---

<div class="post-metadata">

**Author:** ![bend](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/f04885/32.png) [@bend](https://forum.elixirforum.com/u/bend)\
**Post date:** [July 2, 2019, 1:03pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/19 "2019-07-02T13:03:38Z")

</div>

Thanks NobbZ!

---

<div class="post-metadata">

**Author:** ![PragTob](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pragtob/32/2401_2.png) [@PragTob](https://forum.elixirforum.com/u/PragTob)\
**Post date:** [July 2, 2019, 1:41pm UTC](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708/20 "2019-07-02T13:41:59Z")

</div>

Hello,

fellow Linux Mint user here!

The erlang solutions route described for Ubuntu [here](https://elixir-lang.org/install.html#unix-and-unix-like) should work - at least it used to for me. I also switched to asdf though for pure convenience, and yes erlang takes a while to compile but you don’t install new erlang versions all that often 🙂

[Next page](https://forum.elixirforum.com/t/help-installing-elixir-on-linux-mint/22708.md?page=2)
