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.
In this guide, we will install Erlang/OTP in a Opensuse Leap 15.3.
Related Content
- How to install RabbitMQ in OpenSUSE Leap 15.3
- How to install Erlang on Fedora 35
- How to install RabbitMQ in Fedora 35
- How to install Erlang on Rocky Linux/Alma Linux/CentOS 8
- How to install Rabbitmq in Rocky Linux/Alma Linux/Centos 8
Prerequisites
You need the following to follow along
- Updated OpenSUSE Leap Server
- Root access or user with root access
- Internet access from the server
Table of Content
- Updating the system
- Installing Erlang
- Creating Hello world program
1. Updating the system
Let us ensure that our server packages are up to date using this command:
sudo zypper ref
sudo zypper up -y
Let us also install some common packages
sudo zypper install -y vim
2. Installing Erlang
The erlang package is found on the deefault OpenSUSE Leap repos. Install it using this command:
<meta charset="utf-8">sudo zypper install -y erlang
This is the output on my server
~> sudo zypper install -y erlang
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following recommended package was automatically selected:
psqlODBC
The following 6 NEW packages are going to be installed:
erlang erlang-epmd libltdl7 libpq5 psqlODBC unixODBC
6 new packages to install.
Overall download size: 28.9 MiB. Already cached: 0 B. After the operation, additional 52.3 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libltdl7-2.4.6-3.4.1.x86_64 (1/6), 32.6 KiB ( 38.6 KiB unpacked)
Retrieving: libltdl7-2.4.6-3.4.1.x86_64.rpm ....................................................................................[done]
Retrieving package libpq5-14.0-5.3.1.x86_64 (2/6), 172.2 KiB (679.2 KiB unpacked)
Retrieving: libpq5-14.0-5.3.1.x86_64.rpm .......................................................................................[done]
Retrieving package unixODBC-2.3.6-3.2.1.x86_64 (3/6), 306.1 KiB ( 1.0 MiB unpacked)
Retrieving: unixODBC-2.3.6-3.2.1.x86_64.rpm ....................................................................................[done]
Retrieving package psqlODBC-13.01.0000-3.9.1.x86_64 (4/6), 405.1 KiB ( 1.3 MiB unpacked)
Retrieving: psqlODBC-13.01.0000-3.9.1.x86_64.rpm ..................................................................[done (16.3 KiB/s)]
Retrieving package erlang-22.3-1.26.x86_64 (5/6), 27.9 MiB ( 49.2 MiB unpacked)
Retrieving: erlang-22.3-1.26.x86_64.rpm ...........................................................................[done (29.6 MiB/s)]
Retrieving package erlang-epmd-22.3-1.26.x86_64 (6/6), 145.4 KiB ( 55.3 KiB unpacked)
Retrieving: erlang-epmd-22.3-1.26.x86_64.rpm ......................................................................[done (16.4 KiB/s)]
Checking for file conflicts: ...................................................................................................[done]
(1/6) Installing: libltdl7-2.4.6-3.4.1.x86_64 ..................................................................................[done]
(2/6) Installing: libpq5-14.0-5.3.1.x86_64 .....................................................................................[done]
(3/6) Installing: unixODBC-2.3.6-3.2.1.x86_64 ..................................................................................[done]
(4/6) Installing: psqlODBC-13.01.0000-3.9.1.x86_64 .............................................................................[done]
Additional rpm output:
odbcinst: Driver installed. Usage count increased to 1.
Target directory is /etc/unixODBC
(5/6) Installing: erlang-22.3-1.26.x86_64 ......................................................................................[done]
(6/6) Installing: erlang-epmd-22.3-1.26.x86_64 .................................................................................[done]
Additional rpm output:
Created symlink /etc/systemd/system/sockets.target.wants/epmd.socket -> /usr/lib/systemd/system/epmd.socket.
3. Creating Hello world program
Create hello.erl
file
vim hello.erl
Add this to the file
% This is a test Hello World Erlang Code
-module(hello).
-import(io,[fwrite/1]).
-export([helloworld/0]).
helloworld() ->
fwrite("Hello from Citizix, 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 22 [erts-10.7] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V10.7 (abort with ^G)
1> c(hello).
{ok,hello}
2> hello:helloworld().
Hello from Citizix, Erlang World!
ok
3>
You have successfully installed Erlang in your system.
Conclusion
Thanks for using this tutorial for installing the Erlang programming language on your OpenSUSE Leap system. For additional help or useful information, we recommend you to check the official Erlang website.