如何在Ubuntu 20.04 LTS上安装Erlang
admin
2023-08-01 03:07:01
0

Erlang-logoErlang-logo在Ubuntu 20.04 LTS Focal Fossa上安装Erlang

步骤1.首先,通过apt在终端中运行以下命令来确保所有系统软件包都是最新的。

sudo apt update
sudo apt upgrade

步骤2.在Ubuntu 20.04上安装Erlang。

现在,我们通过运行以下命令将存储库添加到您的Ubuntu系统:

echo \"deb https://packages.erlang-solutions.com/ubuntu focal contrib\" | sudo tee /etc/apt/sources.list.d/rabbitmq.list

之后,更新您的系统软件包列表并安装Erlang:

sudo apt update
sudo apt install erlang

安装已完成,要进行验证,我们必须通过提交命令行来使用Shell Erlang:

root@idroot.us:~$ erl
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:6:6] [ds:4:4:16] [async-threads:2]
Eshell V11.1 (abort with ^G)

步骤3.使用Hello World程序测试Erlang。

现在,我们通过编写一个简单的Hello World Erlang代码进行测试:

nano hellotest.erl

添加以下文件:

% Test to display Hello World Erlang Code
-module(hellotest).
-import(io,[fwrite/1]).
-export([helloworld/0]).
helloworld() ->
fwrite(\"Hai Guys.. , Erlang World!\\n\").

保存并关闭,然后使用以下命令执行:

root@idroot.us:~$ erl
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:6:6] [ds:4:4:16] [async-threads:2]
Eshell V11.1 (abort with ^G)
1> c(hellotest).
{ok,hellotest}
2> hellotest01,helloworld().
** exception error: undefined shell command helloworld/0
3> hellotest01:helloworld().
Hai Guys.. , Erlang World!
ok

恭喜你!您已经成功安装了Erlang。有关其他帮助或有用信息,我们建议您检查Erlang官方网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
Hive OS 部署 PXE ... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
如何在电报Telegram中隐... 点击进入:ChatGPT工具插件导航大全 在Android上的电报中隐藏您的电话号码 您可以通过切换...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...
如何在Instagram上扫描... 如何在Instagram上扫描名称标签/ QR? 总而言之,您可以通过大约四种不同的方法来扫描这些I...