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.
-
Which command installs Erlang on Debian or Ubuntu?
Answer
sudo apt install erlangThe
erlangpackage pulls in the runtime, the compiler,escriptand the standard libraries. -
Which command prints the emulator version without starting a shell?
Answer
erl -versionerl -versionprints one line and exits; plainerlstarts the interactive shell. -
What does
erl -versionprint on the machine used in this course?Answer
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 15.2.7.14The option reports the emulator build, which is version 15.2.7.14 for OTP 27 here.
-
Which OTP release does this course use?
Answer
OTP 27
Every example was checked on OTP 27, which the Alpine
erlangpackage provides in this image. -
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.
-
What does
[64-bit]in the first line of theerlbanner 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]. -
Which command starts the interactive shell?
Answer
erlPlain
erlstarts a local node and gives you the shell prompt. -
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 is2>. -
How do you upgrade the
erlangpackage later on Debian or Ubuntu?Answer
sudo apt updatethensudo apt install --only-upgrade erlangapt updaterefreshes the package lists and--only-upgradereplaces the installed Erlang build without touching anything else. -
The shell says
erl: command not foundright after the install. What is the first thing to try?Answer
Open a new terminal and check
PATHThe 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