Install Erlang on Centos 7 with Efficient Steps

In this guide, we want to teach you to Install Erlang on Centos 7. The Erlang programming language is a general-purpose, simultaneous, and garbage-collected programming language, which also serves as a runtime system. The sequential derivative of Erlang is a functional language with firm calculation, single assignment, and dynamic data entry, which concurrently follows the Actor model.

Follow the steps below provided by the Orcacore team to Install Erlang Programming Language on Centos 7.

Steps To Install Erlang on Centos 7

To complete this guide on Erlang Programming Language setup, log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on Initial Server Setup with Centos 7.

1. Erlang Programming Language Setup on Centos 7

The Erlang packages are not provided in the Centos repository. So you need to add it manually on your server. First, update your local package index with the command below:

sudo yum update -y

Then, use the command below to install the Epel repository:

sudo yum install epel-release -y

Add Erlang Repository

Now you need to visit the Erlang Downloads page and get the latest RPM package by using the wget command:

# sudo wget https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm
# sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm

Install Erlang

Now, you can install the Erlang package on your Centos 7 using the following command:

sudo yum install erlang -y

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

sudo yum install esl-erlang -y

2. Test Erlang Installation on Centos 7

At this point, you will learn to test your Erlang installation by creating a sample Hello World project.

First, create a hello.erl file with your favorite text editor, here we use vi:

sudo vi hello.erl

Add the following content to the file:

% This is a test Hello World Erlang Code
-module(hello).
-import(io,[fwrite/1]).
-export([helloworld/0]).

helloworld() ->
   fwrite("Hello from OrcaCore, Erlang World!\n").

When you are done, save and close the file.

Then, you need to compile the program from your Erlang shell.

To access your Erlang shell on Centos 7, run the command below:

erl
Install Erlang on Centos 7

Then, run the commands below:

1> c(hello).
{ok,hello}
2> hello:helloworld().
Hello from OrcaCore, Erlang World!
ok

To exit from your Erl shell, run the command below:

3> q().

For more information, you can visit the Erlang Documentation page.

Conclusion

Erlang is used to build high-performance web servers and APIs, capable of handling a large number of simultaneous connections with minimal downtime. At this point, you have learned to Install Erlang on Centos 7 and create a sample project.

Hope you enjoy it. You may also like these articles:

How To Install OpenSSL 3 on Centos 7

How To Install OpenJDK 17 on Centos 7

Chkrootkit Antivirus For Centos 7

Memcached Setup on Centos 7

Installing FFmpeg on Centos 7

Manage Users on Centos 7

FAQs

What is Erlang, and why install it on CentOS 7?

Erlang is a programming language and system used to build reliable and scalable software. Installing Erlang on CentOS 7 lets you create and run programs that handle many tasks at the same time, like phone systems, messaging apps, and databases.

How do I verify that Erlang is installed correctly?

After the Erlang installation, you can verify it by accessing the Erlang shell with the erl command.

How do I uninstall Erlang from CentOS 7?

You can easily remove it with the following command:
sudo yum remove erlang

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!