Install Erlang and check the version

Install on Linux

Open a terminal on Linux and install the erlang package with the system package manager. On Debian and Ubuntu the APT manager carries a recent OTP build that is good enough for this course.

After the install finishes, move on to the version check below.

sudo apt update

sudo apt install erlang

erl -version

A fresh install should answer with its version line. The emulator version follows the OTP release number.

erl -version

Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 15.2.7.14

If the command is not found, close the terminal, open a new one, and try again.

Start the shell

The interactive shell is called erl, and it starts a local node with a prompt numbered from one. Type an expression, end it with a period, and the shell answers with the value.

The shell also shows the OTP release and the erts version on startup.

erl

Erlang/OTP 27 [erts-15.2.7.14] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Eshell V15.2.7.14 (press Ctrl+G to abort, type help(). for help)

1>

If you see a number like 27, the Erlang side works and you are ready for the next lesson.

Keep Erlang updated

To upgrade later, refresh the package lists and upgrade the erlang package. Then check the version once more to confirm the new build.

If you see a number like 27, the Erlang side works and you are ready for the next lesson.

sudo apt update

sudo apt install --only-upgrade erlang

erl -version

Next: erl: the interactive shell

Questions

A new set of questions in a new order every time. Choose one answer for each, then check.

  1. Which command installs Erlang on Debian or Ubuntu?

    Answer

    sudo apt install erlang

    The erlang package pulls in the runtime, the compiler, escript and the standard libraries.

  2. Which command prints the emulator version without starting a shell?

    Answer

    erl -version

    erl -version prints one line and exits; plain erl starts the interactive shell.

  3. What does erl -version print on the machine used in this course?

    Answer

    Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 15.2.7.14

    The option reports the emulator build, which is version 15.2.7.14 for OTP 27 here.

  4. Which OTP release does this course use?

    Answer

    OTP 27

    Every example was checked on OTP 27, which the Alpine erlang package provides in this image.

  5. What is erts?

    Answer

    The Erlang runtime system, the emulator under BEAM

    erts is the runtime system: the emulator, the process scheduler and the memory handling that BEAM code runs on.

  6. What does [64-bit] in the first line of the erl banner say?

    Answer

    The emulator is a 64-bit executable

    The tag describes the emulator binary itself; the scheduler count appears separately as [smp:4:4].

  7. Which command starts the interactive shell?

    Answer

    erl

    Plain erl starts a local node and gives you the shell prompt.

  8. What shows that the shell is ready for input?

    Answer

    1>

    The prompt counts the queries, so the first one is 1> and the next is 2>.

  9. How do you upgrade the erlang package later on Debian or Ubuntu?

    Answer

    sudo apt update then sudo apt install --only-upgrade erlang

    apt update refreshes the package lists and --only-upgrade replaces the installed Erlang build without touching anything else.

  10. The shell says erl: command not found right after the install. What is the first thing to try?

    Answer

    Open a new terminal and check PATH

    The current terminal may still hold the old PATH; a new terminal picks up the directory the package installed into.

The version lines on this page were produced with Erlang/OTP 27 (erts-15.2.7.14) on Alpine Linux 3.24.3 (x86_64). The install commands themselves need Debian or Ubuntu with root.

Article author: Arthur Isaev