BrightEyesDavid

BrightEyesDavid

Installing Erlang and Elixir in Ubuntu 16.10 Yakkety Yak

Update: I’ve now installed what I believe are the latest stable releases of Erlang, Elixir and Phoenix, and my notes are posted below.

I am still not sure what the difference between the erlang and esl-erlang packages are.


Hello. I’d like to install up-to-date versions of Erlang and Elixir in Ubuntu using repositories so that I can start to try using the Phoenix framework (and learning Elixir/some functional programming!).

Following the instructions here, I first tried to install the https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb package, which said it couldn’t find the system codename and prompted for a system codename input. I cancelled out of the config and purged the deb. The second time I tried, it didn’t say it couldn’t find the system codename but after an apt-get update, apt-cache policy erlang (and elixir and esl-erlang) still only showed the archive.ubuntu.com sources (or none at all in the case of esl-erlang).

At https://packages.erlang-solutions.com/erlang/ there are instructions to install the repositories manually, and I added deb https://packages.erlang-solutions.com/ubuntu yakkety contrib to /etc/apt/sources.list.d/erlang-solutions.list. Doing an apt-get update showed:

Get:8 https://packages.erlang-solutions.com/ubuntu yakkety Release [2,538 B]
Get:9 https://packages.erlang-solutions.com/ubuntu yakkety Release.gpg [836 B]
Get:10 https://packages.erlang-solutions.com/ubuntu yakkety/contrib i386 Packages [18.3 kB]
Get:11 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages [18.3 kB]

Results:

$ apt-cache policy esl-erlang
esl-erlang:
  Installed: (none)
  Candidate: 1:19.1.5
  Version table:
     1:19.1.5 500
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages
     1:19.1.3 500
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages
     1:18.3.4 500
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages

$ apt-cache policy erlang
erlang:
  Installed: (none)
  Candidate: 1:19.1-1
  Version table:
     1:19.1-1 500
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib i386 Packages
     1:18.3.4.4+dfsg-1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu yakkety/universe i386 Packages
     1:18.3-1 500
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib amd64 Packages
        500 https://packages.erlang-solutions.com/ubuntu yakkety/contrib i386 Packages

$ apt-cache policy elixir
elixir:
  Installed: (none)
  Candidate: 1.2.6-1
  Version table:
     1.2.6-1 500
        500 http://de.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu yakkety/universe i386 Packages

While ‘esl-erlang’ and ‘erlang’ have versions from the erlang-solutions repository, ‘elixir’ doesn’t. Am I right in thinking that it should have a version 1.3 from the erlang-solutions repository? Here there are ‘yakkety’ debs listed for erlang- but not elixir-.

There is a elixir_1.3.4-1~ubuntu~xenial_amd64.deb package listed .

There’s also a ‘Ubuntu Yakkety (64-bit)’ deb package available for direct download at https://packages.erlang-solutions.com/erlang/ - would it be worth installing that or is it better to stick to the repository approach (if that will be made to provide the most recent official release of Elixir) for updates?

Thanks.

Most Liked

Oxyrus

Oxyrus

After you’ve installed Erlang successfully I strongly suggest you to try installing it with asdf.

alzearafat

alzearafat

Yeah you were right… :frowning:
Why is this happening… :pensive:

I also found this (kiex), hope it’s helpful

BrightEyesDavid

BrightEyesDavid

I believe the package name is esl-erlang, not erlang-esl. Did you install the erlang-solutions repositories before installing with apt-get? (I still don’t know the difference between erlang and esl-erlang. :slight_smile: )

Regarding asdf, I found that sourcing .bashrc after it had been added to wasn’t in the instructions. I don’t know if that could be why it didn’t seem to work for you?

In case they’re of use to anyone else, here are my notes on the process I ended up with.


Install Erlang (and maybe Elixir) from erlang-solutions source repository

Find Ubuntu’s codename with lsb_release -c

Make /etc/apt/sources.list.d/erlang-solutions.list and insert:

deb https://packages.erlang-solutions.com/ubuntu <ubuntu-codename> contrib

Update package index and install Erlang:

sudo apt-get update
sudo apt-get install erlang

Check which version of Elixir would be installed via package:

apt-cache policy elixir

If the version stated is the current release:

sudo apt-get install elixir
elixir -v

If not, install Elixir with asdf.

Install Elixir with asdf (if required)

Check the current asdf documentation for up-to-date instructions. At the time of writing, installing asdf and using it to install Elixir is done as follows.

Install asdf

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.2.0
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
. ~/.bashrc

Install recommended packages

sudo apt-get install automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev

Add the asdf Elixir plugin

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

Install Elixir and set it as the current global version

asdf install elixir 1.3.4
asdf global elixir 1.3.4
elixir -v

Install hex, rebar and Phoenix

mix local.hex
mix local.rebar
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Install inotify

sudo apt-get install inotify-tools

Install Node.js (if required)

Node.js is required for asset compilation with Brunch.

See Installing Node.js via package manager.

At time of writing:

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install nodejs
node --version

Install PostgreSQL (if required)

See Ubuntu Wiki: PostgreSQL.

At time of writing:

sudo apt-get install postgresql postgresql-contrib
sudo -u postgres psql postgres

In PostgreSQL, set postgres user password (to something random/secure) and create user for our Phoenix app:

\password postgres
CREATE ROLE hello_phoenix WITH PASSWORD 'hello_phoenix' LOGIN CREATEDB;
\q

Create a new Phoenix project

To test if everything’s ready:

mix phoenix.new hello_phoenix

Update database username and password in the config files with those used when creating the role.

  • hello_phoenix/config/dev.exs
  • hello_phoenix/config/test.exs
cd hello_phoenix
mix ecto.create
mix test
mix phoenix.server

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
yawaramin
In the Dialyzer docs ( dialyzer — OTP 29.0.2 (dialyzer 6.0.1) ), there is a way to turn off a specific warning for a function: -dialyzer...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement