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
PragTob

PragTob

The experiment on my 2 newly setup machines is to use asdf for nearly everything. E.g. I use it for ruby, elixir, erlang and node atm and am very happy. I also didn’t install erlang before - all just through asdf :slight_smile:

alzearafat

alzearafat

I installed it on Ubuntu 16.04, with no issues at all. Could it be different with 16.10? :confused:

So, this method is better than official tutorial?

Where Next?

Popular in Questions Top

LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
Kagamiiiii
Student &amp; New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
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
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New

We're in Beta

About us Mission Statement