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
alzearafat
Yeah you were right… ![]()
Why is this happening… ![]()
I also found this (kiex), hope it’s helpful
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.
)
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)
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.exshello_phoenix/config/test.exs
cd hello_phoenix
mix ecto.create
mix test
mix phoenix.server
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









