{"id":13557,"date":"2022-01-06T12:43:49","date_gmt":"2022-01-06T12:43:49","guid":{"rendered":"https:\/\/linuxways.net\/?p=13557"},"modified":"2022-01-06T12:43:56","modified_gmt":"2022-01-06T12:43:56","slug":"how-to-install-and-run-the-erlang-programming-language-in-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-and-run-the-erlang-programming-language-in-ubuntu-20-04\/","title":{"rendered":"How to Install and Run the Erlang Programming Language in Ubuntu 20.04"},"content":{"rendered":"<h2><span style=\"font-weight: 400\">Introduction<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Erlang is a concurrent programming language with a garbage-collected runtime environment designed for concurrency, fault tolerance, and distributed application architectures. Concurrent processes are used to structure Erlang applications. These processes communicate asynchronously by exchanging messages and do not share memory. Erlang processes are small and belong to the language rather than the operating system.Ericsson&#8217;s OTP product unit is responsible for its support and maintenance.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Erlang is a programming language for building Massively scalable soft real-time systems with high availability requirements.Telecoms,banking,E-commerce,Computer Telephone and instant messaging are few examples of the applications.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">1.Installation using repository<\/span><\/h2>\n<h3><span style=\"font-weight: 400\">1. Adding repository entry<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Using the <\/span><b>wget<\/b><span style=\"font-weight: 400\"> command, pulling all the packages of the Erlang solution and adding the Erlang Solution repository to the system.<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> wget https:\/\/packages.erlang-solutions.com\/erlang-solutions_2.0_all.deb<\/span><\/pre>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> sudo dpkg -i erlang-solutions_2.0_all.deb<\/span><\/pre>\n<h2><span style=\"font-weight: 400\">2.Installing Erlang<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Update the system with the latest release packages by a given command.<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> sudo apt-get update<\/span><\/pre>\n<p><span style=\"font-weight: 400\">Now, install the erlang packages using <\/span><b>apt-get install<\/b><span style=\"font-weight: 400\"> command<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> sudo apt-get install erlang<\/span><\/pre>\n<p><span style=\"font-weight: 400\">After installing the packages the question pops up whether you want to proceed or not for further installation. Type y for further installation.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Login to Ergan shell to check the installation process is successful.<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> erl<\/span><\/pre>\n<h2><span style=\"font-weight: 400\">2.File created for testing Erlang<\/span><\/h2>\n<p><b>vim <\/b><span style=\"font-weight: 400\">command is used to open the file for editing the information.<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> vim hello.erl<\/span><\/pre>\n<p><span style=\"font-weight: 400\">Following steps are added to the file created in the name of <\/span><b>hello.erl<\/b><span style=\"font-weight: 400\"> to execute the erlang programming code.<\/span><\/p>\n<pre><b>% Test of Erlang Code<\/b>\r\n\r\n<b>-module(hello).<\/b>\r\n\r\n<b>-import(io,[fwrite\/1]).<\/b>\r\n\r\n<b>-export([helloworld\/0]).<\/b>\r\n\r\n<b>helloworld() -&gt;<\/b>\r\n\r\n<b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0fwrite(\"Linuxways says hi!\\n\").<\/b><\/pre>\n<p><span style=\"font-weight: 400\">Now,login to the Erlang shell to test the file created and execute the given code to check if the programming is running.(Do not forget to use the full stop sign (.) at the end).\u00a0<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> erl<\/span><\/pre>\n<pre><span style=\"font-weight: 400\">1&gt;\u00a0 c(hello).<\/span>\r\n\r\n<span style=\"font-weight: 400\">2&gt; hello:helloworld().<\/span>\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Another program is also tested for better understanding.<\/span><\/p>\n<pre><b>Sam@linuxways:~$ <\/b><span style=\"font-weight: 400\">vim output.erl<\/span><\/pre>\n<pre><b>-module(output).<\/b>\r\n\r\n<b>-export([double\/1,mult\/2]).<\/b>\r\n\r\n<b>mult(X,Y) -&gt;<\/b>\r\n\r\n<b>X*Y.<\/b>\r\n\r\n<b>double(X) -&gt;<\/b>\r\n\r\n<b>mult(2,X)<\/b><\/pre>\n<p><span style=\"font-weight: 400\">Now,login to the Erlang shell to test the file created and execute the given code to check if the program is running.<\/span><\/p>\n<pre><b>Sam@linuxways:~$<\/b><span style=\"font-weight: 400\"> erl<\/span><\/pre>\n<pre><span style=\"font-weight: 400\">1&gt; c(output).<\/span>\r\n\r\n<span style=\"font-weight: 400\">2&gt; output:double(20).<\/span>\r\n\r\n<span style=\"font-weight: 400\">3&gt; output:mult(5,10).<\/span><\/pre>\n<p><span style=\"font-weight: 400\">\u00a0<\/span><span style=\"font-weight: 400\">The Erlang programming language is successfully installed and tested in the Linux system.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">3.Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400\">The above given command and its example is for the installation of Erlang Programming language on Ubuntu 20.04 .Thank you for checking it out!<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Erlang is a concurrent programming language with a garbage-collected runtime environment designed for concurrency, fault tolerance, and distributed application architectures. Concurrent processes are used to structure Erlang&hellip;<\/p>","protected":false},"author":1,"featured_media":13684,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[815,100],"class_list":["post-13557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-erlang","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13557"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13557\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13684"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}