GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Comment installer Erlang sur Ubuntu 20.04

Dans ce guide, nous allons installer Erlang/OTP dans un Ubuntu 20.04.

Contenu associé

  • Comment installer Erlang sur FreeBSD 13
  • Comment installer Erlang sur Opensuse Leap 15.3
  • Comment installer RabbitMQ dans OpenSUSE Leap 15.3
  • Comment installer Erlang sur Fedora 35
  • Comment installer RabbitMQ dans Fedora 35
  • Comment installer Erlang sur Rocky Linux/Alma Linux/CentOS 8
  • Comment installer Rabbitmq dans Rocky Linux/Alma Linux/Centos 8

Prérequis

Vous avez besoin des éléments suivants pour suivre

  • Serveur Ubuntu mis à jour
  • Accès root ou utilisateur avec accès root
  • Accès Internet depuis le serveur

Table des matières

  1. Mise à jour du système
  2. Installer Erlang
  3. Création du programme Hello world

1. Mise à jour du système

Assurons-nous que nos packages de serveur sont à jour en utilisant cette commande :

sudo apt update
sudo apt upgrade -y

Installons également quelques packages courants

sudo apt install -y vim

2. Installer Erlang

Le package erlang se trouve sur les référentiels Ubuntu Leap par défaut. Installez-le à l'aide de cette commande :

sudo apt install -y erlang

Vous devriez maintenant avoir installé erlang.

3. Création du programme Hello world

Créer hello.erl fichier

vim hello.erl

Ajoutez ceci au fichier

% 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").

Compilez-le à partir du shell Erlang. N'oubliez pas le point ("point") à la fin de chaque commande :

$ erl
Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]

Eshell V10.6.4  (abort with ^G)
1> c(hello).
{ok,hello}
2> hello:helloworld().
Hello from Citizix, Erlang World!
ok
3>

Vous avez installé avec succès Erlang sur votre système.

Conclusion

Merci d'avoir utilisé ce tutoriel pour installer le langage de programmation Erlang sur votre système Ubuntu. Pour obtenir de l'aide supplémentaire ou des informations utiles, nous vous recommandons de consulter le site Web officiel d'Erlang.


Ubuntu
  1. Comment installer Erlang sur Ubuntu 20.04

  2. Comment installer Erlang sur Ubuntu 16.04 LTS

  3. Comment installer Erlang sur Ubuntu 20.04 LTS

  4. Comment installer R sur Ubuntu 16.04

  5. Comment installer Go sur Ubuntu 18.04

Comment installer R sur Ubuntu 20.04

Comment installer Go sur Ubuntu 18.04

Comment installer R sur Ubuntu 18.04

Comment installer qt sur Ubuntu 20.04

Comment installer Go dans Ubuntu 20.04

Comment installer Go sur Ubuntu 22.04