How to install Erlang on ArchLinux

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 on ArchLinux.

Prerequisites

You need the following to follow along

  • Updated ArchLinux server/Workstation
  • Root access or user with root access
  • Internet access from the server

Table of Content

  1. Updating the system
  2. Installing Erlang
  3. Creating Hello world program

1. Updating the system

Let us ensure that our server packages are up to date using this command:

sudo pacman -Syyu

Let us also install some common packages

sudo pacman -S vim

2. Installing Erlang

Install erlang using pacman:

sudo pacman -S erlang

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
/usr/lib/erlang/erts-12.1.5/bin/beam.smp: /usr/lib/libncursesw.so.6: no version information available (required by /usr/lib/erlang/erts-12.1.5/bin/beam.smp)
Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]

Eshell V12.1.5  (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 Arch Linux system. For additional help or useful information, we recommend you to check the official Erlang website.

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy