Erlang is a concurrent programming language with a garbage-collected runtime environment designed for concurrency, fault tolerance, and distributed application architectures. Concurrent processes are used to structure Erlang applications. These processes communicate asynchronously by exchanging messages and do not share memory. Erlang processes are small and belong to the language rather than the operating system.Ericsson's OTP product unit is responsible for its support and maintenance.
It is a programming language for building Massively scalable soft real-time systems with high availability requirements. Telecoms, banking, E-commerce, Computer Telephone and instant messaging are few examples of the applications.
Here at LinuxAPT, we will look into how to install Erlang on Ubuntu 20.04 LTS.
1. Perform System Update
To begin, ensure that all your system packages are up-to-date by running the following apt commands in the terminal:
$ sudo apt update
$ sudo apt upgrade
2. Install Erlang on the system
Now we add the repository to your Ubuntu system by running the following commands:
$ echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
After that, update your system package list and install Erlang:
$ sudo apt update
$ sudo apt install erlang
Next, to verify the installation of erlang, we have to use the Shell Erlang command via the command line:
$ erl
3. Test Erlang with Hello World Program
Now we will test by writing a simple Hello World Erlang code:
$ nano hellotest.erl
Add the following file:
% Test to display Hello World Erlang Code
-module(hellotest).
-import(io,[fwrite/1]).
-export([helloworld/0]).
helloworld() ->
fwrite("Coding Guys.. , Erlang World!\n").
Save and close, after that execute using the following command:
$ erl
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:6:6] [ds:4:4:16] [async-threads:2]
Eshell V11.1 (abort with ^G)
1> c(hellotest).
{ok,hellotest}
2> hellotest01,helloworld().
** exception error: undefined shell command helloworld/0
3> hellotest01:helloworld().
Coding Guys.. , Erlang World!
ok
To uninstall only the erlang package we can use the following command:
$ sudo apt-get remove erlang
We can use the following command to remove erlang configurations, data and all of its dependencies, we can use the following command:
$ sudo apt-get -y autoremove --purge erlang
This article covers how to install the Erlang programming language on your Ubuntu 20.04 LTS Focal Fossa system. In fact, Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance.