GNU/Linux >> Belajar Linux >  >> OpenSuse

Bagaimana cara menginstal Erlang di Opensuse Leap 15.3

Dalam panduan ini, kita akan menginstal Erlang/OTP di Opensuse Leap 15.3.

Konten Terkait

  • Cara menginstal RabbitMQ di OpenSUSE Leap 15.3
  • Cara menginstal Erlang di Fedora 35
  • Cara menginstal RabbitMQ di Fedora 35
  • Cara menginstal Erlang di Rocky Linux/Alma Linux/CentOS 8
  • Cara menginstal Rabbitmq di Rocky Linux/Alma Linux/Centos 8

Prasyarat

Anda perlu mengikuti yang berikut ini

  • Server Leap OpenSUSE yang Diperbarui
  • Akses root atau pengguna dengan akses root
  • Akses internet dari server

Daftar Isi

  1. Memperbarui sistem
  2. Menginstal Erlang
  3. Membuat program Hello world

1. Memperbarui sistem

Mari kita pastikan bahwa paket server kita up to date menggunakan perintah ini:

sudo zypper ref
sudo zypper up -y

Mari kita juga menginstal beberapa paket umum

sudo zypper install -y vim

2. Memasang Erlang

Paket erlang ditemukan pada repo OpenSUSE Leap default. Instal menggunakan perintah ini:

sudo zypper install -y erlang

Ini adalah output di server saya

~> sudo zypper install -y erlang
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following recommended package was automatically selected:
  psqlODBC

The following 6 NEW packages are going to be installed:
  erlang erlang-epmd libltdl7 libpq5 psqlODBC unixODBC

6 new packages to install.
Overall download size: 28.9 MiB. Already cached: 0 B. After the operation, additional 52.3 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libltdl7-2.4.6-3.4.1.x86_64                                                   (1/6),  32.6 KiB ( 38.6 KiB unpacked)
Retrieving: libltdl7-2.4.6-3.4.1.x86_64.rpm ....................................................................................[done]
Retrieving package libpq5-14.0-5.3.1.x86_64                                                      (2/6), 172.2 KiB (679.2 KiB unpacked)
Retrieving: libpq5-14.0-5.3.1.x86_64.rpm .......................................................................................[done]
Retrieving package unixODBC-2.3.6-3.2.1.x86_64                                                   (3/6), 306.1 KiB (  1.0 MiB unpacked)
Retrieving: unixODBC-2.3.6-3.2.1.x86_64.rpm ....................................................................................[done]
Retrieving package psqlODBC-13.01.0000-3.9.1.x86_64                                              (4/6), 405.1 KiB (  1.3 MiB unpacked)
Retrieving: psqlODBC-13.01.0000-3.9.1.x86_64.rpm ..................................................................[done (16.3 KiB/s)]
Retrieving package erlang-22.3-1.26.x86_64                                                       (5/6),  27.9 MiB ( 49.2 MiB unpacked)
Retrieving: erlang-22.3-1.26.x86_64.rpm ...........................................................................[done (29.6 MiB/s)]
Retrieving package erlang-epmd-22.3-1.26.x86_64                                                  (6/6), 145.4 KiB ( 55.3 KiB unpacked)
Retrieving: erlang-epmd-22.3-1.26.x86_64.rpm ......................................................................[done (16.4 KiB/s)]

Checking for file conflicts: ...................................................................................................[done]
(1/6) Installing: libltdl7-2.4.6-3.4.1.x86_64 ..................................................................................[done]
(2/6) Installing: libpq5-14.0-5.3.1.x86_64 .....................................................................................[done]
(3/6) Installing: unixODBC-2.3.6-3.2.1.x86_64 ..................................................................................[done]
(4/6) Installing: psqlODBC-13.01.0000-3.9.1.x86_64 .............................................................................[done]
Additional rpm output:
odbcinst: Driver installed. Usage count increased to 1.
    Target directory is /etc/unixODBC


(5/6) Installing: erlang-22.3-1.26.x86_64 ......................................................................................[done]
(6/6) Installing: erlang-epmd-22.3-1.26.x86_64 .................................................................................[done]
Additional rpm output:
Created symlink /etc/systemd/system/sockets.target.wants/epmd.socket -> /usr/lib/systemd/system/epmd.socket.

3. Membuat program Hello world

Buat hello.erl berkas

vim hello.erl

Tambahkan ini ke file

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

Kompilasi dari shell Erlang. Jangan lupa tanda titik (“titik”) di akhir setiap perintah:

~> erl
Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

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

Anda telah berhasil menginstal Erlang di sistem Anda.

Kesimpulan

Terima kasih telah menggunakan tutorial ini untuk menginstal bahasa pemrograman Erlang pada sistem OpenSUSE Leap Anda. Untuk bantuan tambahan atau informasi yang berguna, kami menyarankan Anda untuk memeriksa situs resmi Erlang.


OpenSuse
  1. Cara Menginstal &Mengkonfigurasi Postgres 14 di OpenSUSE Leap 15.3

  2. Cara menginstal dan menggunakan Podman di OpenSUSE Leap 15.3

  3. Bagaimana menginstal Java 17 di OpenSUSE Leap 15.3

  1. Bagaimana menginstal Mongodb 5 di Opensuse Leap 15.3

  2. Bagaimana menginstal Mysql Server 8 pada OpenSUSE Leap 15.3

  3. Cara menginstal &mengkonfigurasi Redis 6 pada OpenSUSE Leap 15.3

  1. Cara Memasang LAMP Stack di OpenSUSE Leap 42.1

  2. Cara Menginstal Desktop KDE OpenSUSE Leap 42.1

  3. Cara Menginstal dan Mengkonfigurasi Mariadb 10 di OpenSUSE Leap 15.3