Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Erlang runtime system has built-in support for concurrency, distribution and fault tolerance. This tutorial will help you to install Erlang on Ubuntu 18.04 and 16.04 using PPA.

Advertisement

Step 1 – Adding Repository

First, use the following commands to add erlang apt repository on your system. You can simply download erlang repository package from its official website and install on your system.

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

Step 2 – Install Erlang on Ubuntu

Now, you can install an erlang package on your system using the following command. This will install all of its dependencies as well.

sudo apt-get update
sudo apt-get install erlang

Alternatively, you can do the complete erlang installation. It includes the Erlang/OTP platform and all of its applications.

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

Step 3 – Erlang Hello World Program

Let’s start with hello world program on erlang. First create file helloworld.erl with following content.

vi helloworld.erl

add the following contnet.

% hello world program
-module(helloworld).
-export([start/0]).

start() ->
io:fwrite("Hello World!\n").

Now compile the hello world program using below command.

erlc helloworld.erl

The above command will create a file helloworld.beam in the current directory. You can run your program now.

erl -noshell -s helloworld start -s init stop

Hello World!

Reference:
https://packages.erlang-solutions.com/erlang/

Share.

2 Comments

  1. Thank you so much! I spent hours beating my head against trying to get erlang and elixir working properly on my machine to no avail. I followed your instructions step by step and it worked perfectly on Ubuntu 17.10(Artful Ardvark)


Exit mobile version