Installing Erlang on Ubuntu 20.x

The steps below are taken from the sites listed in the reference, recreating here for my reference.

Installing

sudo apt update
sudo apt install software-properties-common apt-transport-https
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/erlang.list
sudo apt update
sudo apt install erlang

Checking it all worked

Let’s check if everything worked. You can just run

erl

from your terminal OR let’s write the good ol’ hello world by create helloworld.erl and add the following code

-module(helloworld). 
-export([start/0]). 
start() -> io:fwrite("Hello World\n").

Run this using

erlc helloworld.erl
// then
erl -noshell -s helloworld start -s init stop

If all went well you’ll see Hello World written to standard io.

To add the last bit of the How to Install Erlang in Ubuntu post, to remove Erlang run

sudo apt remove erlang
sudo apt autoremove

References

How To Install Erlang on Ubuntu 22.04|20.04|18.04
How to Install Erlang in Ubuntu