Install Erlang on Rocky Linux
DNF and EPEL on Rocky Linux
The Linux distribution
Rocky does not carry
Erlang in its own BaseOS and AppStream
repositories, so dnf finds no erlang package on a fresh system. The
package comes from
EPEL,
Extra Packages for Enterprise Linux, which carries Erlang/OTP 26 for
Rocky Linux 9.
Install the EPEL release package first, then Erlang itself. The sudo
commands ask for the password of your own user.
sudo dnf install epel-release
sudo dnf update
sudo dnf install erlang
Verify the install
The shell is the program erl. Ask it for the version: the answer names the emulator and its version, which belongs to the OTP release that the package manager installed.
erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 15.2.7.14
Ask the runtime for the OTP release number itself:
erl -noshell -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
27
Both answers were measured on Erlang/OTP 27; the EPEL 9 package is Erlang/OTP 26 and prints its own numbers.
If erl is not found, close the terminal, open a new one, and try again.
Erlang and Elixir
Elixir is a language that compiles to the
same BEAM bytecode and runs on the same virtual machine, the same
libraries and the same error handling. It adds a Ruby-like syntax and
metaprogramming macros on the same foundation.
EPEL 9 carries Erlang, not Elixir: the erlang package above is the
runtime that Elixir needs. The
Elixir course starts with the install
of Elixir itself.
Article author: Arthur Isaev