Are you searching for How to install Erlang on RHEL 8 / CentOS 8?. Erlang is a functional, general-purpose, concurrent programming language and garbage-collected runtime environment built for concurrency, fault tolerance, and distributed application architectures. It is supported and maintained by Ericsson OTP product unit.
When working with Erlang, you’ll often hear the term OTP. OTP (Open Telecom Platform) is a collection of libraries and middleware for Erlang. This guide will cover the steps to install Erlang/OTP on RHEL 8 / CentOS 8.
Install Latest Erlang on RHEL 8 | CentOS 8
Erlang packages are available in Github RabbitMQ repository. It is recommended to always install the latest release which you can check the Erlang RPM releases page.
Add the YUM repository:
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
Clean yum cache and update:
sudo yum clean all
sudo yum -y makecache
Then install the latest release of Erlang on CentOS 8 | RHEL 8 system:
sudo yum install erlang
Hit the y key in the keyboard to begin installation of Erlang on CentOS 8 | RHEL 8:
Last metadata expiration check: 0:00:55 ago on Tue 22 Sep 2020 09:50:06 PM UTC.
Dependencies resolved.
==================================================================================================================================================================
Package Architecture Version Repository Size
==================================================================================================================================================================
Installing:
erlang x86_64 23.0.4-1.el8 rabbitmq_erlang 25 M
Transaction Summary
==================================================================================================================================================================
Install 1 Package
Total download size: 25 M
Installed size: 60 M
Is this ok [y/N]: y
Confirm installation by running the erl
command:
$ erl
Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Eshell V13.1.3 (abort with ^G)
1>
Test by writing a simple Hello World Erlang code.
$ vim hello.erl
% This is a test Hello World Erlang Code
-module(hello).
-import(io,[fwrite/1]).
-export([helloworld/0]).
helloworld() ->
fwrite("Hello, Erlang World!\n").
Compile it from the Erlang shell. Don’t forget the full-stop (“period“) at the end of each command.
$ erl
Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]
Eshell V13.1.3 (abort with ^G)
1> c(hello).
{ok,hello}
2>
Then run the program from the Erlang shell:
2> hello:helloworld().
Hello, Erlang World!
ok
See below screenshot:
Enjoy Developing with Erlang on RHEL 8 / CentOS 8. Check other RHEL 8 / CentOS 8 articles available on our blog.