GNU/Linux >> Tutoriels Linux >  >> Cent OS

Comment installer Erlang sur Rocky Linux/Alma Linux/CentOS 8

Dans ce guide, nous allons installer Erlang/OTP dans un Rocky Linux/Alma Linux/CentOS 8.

Contenu associé

  • Comment installer Rabbitmq dans Rocky Linux/Alma Linux/Centos 8
  • Comment installer RabbitMQ dans Fedora 35
  • Comment installer Erlang sur Fedora 35

Prérequis

Vous avez besoin des éléments suivants pour suivre

  • Mise à jour du serveur Rocky Linux/Alma Linux 8
  • 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 dnf -y update

Installons également quelques packages courants

sudo dnf install vim -y

2. Installer Erlang

Le package Erlang est distribué via les référentiels Yum sur PackageCloud. Installez le référentiel PackageCloud Yum à l'aide de cette commande :

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash

Ceci est la sortie sur mon serveur

$ curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash

Detected operating system as rocky/8.
Checking for curl...
Detected curl...
Downloading repository file: https://packagecloud.io/install/repositories/rabbitmq/erlang/config_file.repo?os=rocky&dist=8&source=script
done.
Installing yum-utils...

Rocky Linux 8 - AppStream                                                                                                       15 kB/s | 4.8 kB     00:00
Rocky Linux 8 - BaseOS                                                                                                         6.5 kB/s | 4.3 kB     00:00
Rocky Linux 8 - Extras                                                                                                          27 kB/s | 3.5 kB     00:00
rabbitmq_erlang-source                                                                                                         1.3 kB/s | 819  B     00:00
rabbitmq_erlang-source                                                                                                          21 kB/s | 3.8 kB     00:00
Importing GPG key 0xDF309A0B:
 Userid     : "https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 2EBD E413 D3CE 5D35 BCD1 5B7C 71C6 3471 DF30 9A0B
 From       : https://packagecloud.io/rabbitmq/erlang/gpgkey
rabbitmq_erlang-source                                                                                                         357  B/s | 296  B     00:00
Package yum-utils-4.0.18-4.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Generating yum cache for rabbitmq_erlang...
Importing GPG key 0xDF309A0B:
 Userid     : "https://packagecloud.io/rabbitmq/erlang (https://packagecloud.io/docs#gpg_signing) <[email protected]>"
 Fingerprint: 2EBD E413 D3CE 5D35 BCD1 5B7C 71C6 3471 DF30 9A0B
 From       : https://packagecloud.io/rabbitmq/erlang/gpgkey
Generating yum cache for rabbitmq_erlang-source...

The repository is setup! You can now install packages.

Nous pouvons maintenant installer erlang à partir des dépôts ajoutés :

$ sudo dnf install erlang
Last metadata expiration check: 0:00:27 ago on Fri 12 Nov 2021 07:30:53 AM EAT.
Dependencies resolved.
===============================================================================================================================================================
 Package                           Architecture                      Version                                  Repository                                  Size
===============================================================================================================================================================
Installing:
 erlang                            x86_64                            24.1-1.el8                               rabbitmq_erlang                             20 M

Transaction Summary
===============================================================================================================================================================
Install  1 Package

Total download size: 20 M
Installed size: 36 M
Is this ok [y/N]: y
Downloading Packages:
erlang-24.1-1.el8.x86_64.rpm                                                                                                    42 MB/s |  20 MB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           41 MB/s |  20 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                       1/1
  Installing       : erlang-24.1-1.el8.x86_64                                                                                                              1/1
  Running scriptlet: erlang-24.1-1.el8.x86_64                                                                                                              1/1
  Verifying        : erlang-24.1-1.el8.x86_64                                                                                                              1/1

Installed:
  erlang-24.1-1.el8.x86_64

Complete!

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 24 [erts-12.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]

Eshell V12.1  (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 Rocky Linux/Alma Linux 8. Pour obtenir de l'aide supplémentaire ou des informations utiles, nous vous recommandons de consulter le site Web officiel d'Erlang.


Cent OS
  1. Comment debootstrap sur CentOS Linux

  2. Comment installer et configurer Redis 6 sur Rocky Linux/Centos 8

  3. Comment installer Java 17 sur Rocky Linux 8/Centos 8

  4. Comment installer et utiliser Podman dans Rocky Linux/Alma Linux/Centos 8

  5. Comment installer FFmpeg sur Rocky Linux/Alma Linux 8

Comment installer Apache Maven sur Rocky Linux / CentOS 8

Comment installer Spotify sur CentOS 8 / Rocky Linux

Comment installer Webmin sur CentOS Linux

Comment installer JIRA sur CentOS 8 Linux

Comment installer Rabbitmq dans Rocky Linux/Alma Linux/Centos 8

Comment configurer la réplication FreeIPA sur Rocky Linux/Alma Linux/Centos 8