Installing up-to-date version of Erlang on RHEL7

user272735 picture user272735 · May 3, 2018 · Viewed 7.7k times · Source

I'm trying to install an up to date (version 20.3 at the moment of the writing) Erlang distribution into RHEL7 (release 7.5 to be exact).

Google tells me the up-to-date Erlang distribution is maintained by Erlang Solutions at https://packages.erlang-solutions.com/ (thanks!)

There you also find instructions how to add the repository so that the Erlang can be installed with a package manager:

Installation using repository

  1. Adding repository entry

To add Erlang Solutions repository (including our public key for verifying signed package) to your system, call the following commands:

wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm

However if I run the commands (I run the rpm command as a root) no Erlang Solutions repo is added to yum repolist. Is RHEL7 different to Centos or are the instructions faulty or what I'm doing wrong ?

The Erlang Solutions repo (and the installation instructions) is referenced also from

Answer

user272735 picture user272735 · May 4, 2018

I found the root cause and was able to install Erlang from Erlang Solutions repository.

The root cause was that $releasever is different in RHEL than in Centos and therefore the variable can't be used but has to be changed to a hardcoded value.

The following is a detailed steps how to setup yum so that Erlang and it's dependencies can be installed from Erlang Solutions and EPEL repositories with yum.

Add the following Erlang Solutions repository file:

[root@red ~]# cat /etc/yum.repos.d/erlang-solutions.repo 
[erlang-solutions]
name=CentOS $releasever - $basearch - Erlang Solutions
baseurl=https://packages.erlang-solutions.com/rpm/centos/7/$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
[root@red ~]#

Note that baseurl had to be changed from

https://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch

to

https://packages.erlang-solutions.com/rpm/centos/7/$basearch

Add EPEL repository too for dependecies required by Erlang (wxBase, wxGTK, wxGTK-gl):

[root@red ~]# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Repolist looks now:

[root@red ~]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
repo id                                    repo name                                                      status
epel/x86_64                                Extra Packages for Enterprise Linux 7 - x86_64                 12,517
erlang-solutions/x86_64                    CentOS 7Server - x86_64 - Erlang Solutions                        992
rhel-7-server-extras-rpms/x86_64           Red Hat Enterprise Linux 7 Server - Extras (RPMs)                 814
rhel-7-server-optional-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server - Optional (RPMs)            14,947
rhel-7-server-rpms/7Server/x86_64          Red Hat Enterprise Linux 7 Server (RPMs)                       20,120
rhel-7-server-rt-rpms/7Server/x86_64       Red Hat Enterprise Linux for Real Time (RHEL 7 Server) (RPMs)     281
rhel-server-rhscl-7-rpms/7Server/x86_64    Red Hat Software Collections RPMs for Red Hat Enterprise Linux  9,961
repolist: 59,632
[root@red ~]#

Erlang package is available !

[root@red ~]# yum info erlang
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Available Packages
Name        : erlang
Arch        : x86_64
Version     : 20.3
Release     : 1.el7.centos
Size        : 17 k
Repo        : erlang-solutions/x86_64
Summary     : General-purpose programming language and runtime environment
URL         : http://www.erlang.org
License     : ERPL
Description : Erlang is a general-purpose programming language and runtime
            : environment. Erlang has built-in support for concurrency, distribution
            : and fault tolerance. Erlang is used in several large telecommunication
            : systems from Ericsson.

[root@red ~]#

And finally you can install Erlang with yum -y install erlang.

The following packages from several different repositories were installed:

================================================================================================================
 Package                         Arch            Version                      Repository                   Size
================================================================================================================
Installing:
 erlang                          x86_64          20.3-1.el7.centos            erlang-solutions             17 k
Installing for dependencies:
 SDL                             x86_64          1.2.15-14.el7                rhel-7-server-rpms          204 k
 erlang-asn1                     x86_64          20.3-1.el7.centos            erlang-solutions            928 k
 erlang-common_test              x86_64          20.3-1.el7.centos            erlang-solutions            1.3 M
 erlang-compiler                 x86_64          20.3-1.el7.centos            erlang-solutions            1.4 M
 erlang-cosEvent                 x86_64          20.3-1.el7.centos            erlang-solutions            170 k
 erlang-cosEventDomain           x86_64          20.3-1.el7.centos            erlang-solutions            137 k
 erlang-cosFileTransfer          x86_64          20.3-1.el7.centos            erlang-solutions            200 k
 erlang-cosNotification          x86_64          20.3-1.el7.centos            erlang-solutions            842 k
 erlang-cosProperty              x86_64          20.3-1.el7.centos            erlang-solutions            188 k
 erlang-cosTime                  x86_64          20.3-1.el7.centos            erlang-solutions            124 k
 erlang-cosTransactions          x86_64          20.3-1.el7.centos            erlang-solutions            196 k
 erlang-crypto                   x86_64          20.3-1.el7.centos            erlang-solutions            212 k
 erlang-debugger                 x86_64          20.3-1.el7.centos            erlang-solutions            468 k
 erlang-dialyzer                 x86_64          20.3-1.el7.centos            erlang-solutions            838 k
 erlang-diameter                 x86_64          20.3-1.el7.centos            erlang-solutions            835 k
 erlang-edoc                     x86_64          20.3-1.el7.centos            erlang-solutions            366 k
 erlang-eldap                    x86_64          20.3-1.el7.centos            erlang-solutions            125 k
 erlang-erl_docgen               x86_64          20.3-1.el7.centos            erlang-solutions            156 k
 erlang-erl_interface            x86_64          20.3-1.el7.centos            erlang-solutions            263 k
 erlang-erts                     x86_64          20.3-1.el7.centos            erlang-solutions            2.0 M
 erlang-et                       x86_64          20.3-1.el7.centos            erlang-solutions            189 k
 erlang-eunit                    x86_64          20.3-1.el7.centos            erlang-solutions            185 k
 erlang-examples                 x86_64          20.3-1.el7.centos            erlang-solutions            1.0 M
 erlang-hipe                     x86_64          20.3-1.el7.centos            erlang-solutions            3.2 M
 erlang-ic                       x86_64          20.3-1.el7.centos            erlang-solutions            1.0 M
 erlang-inets                    x86_64          20.3-1.el7.centos            erlang-solutions            921 k
 erlang-jinterface               x86_64          20.3-1.el7.centos            erlang-solutions            179 k
 erlang-kernel                   x86_64          20.3-1.el7.centos            erlang-solutions            1.3 M
 erlang-megaco                   x86_64          20.3-1.el7.centos            erlang-solutions            6.0 M
 erlang-mnesia                   x86_64          20.3-1.el7.centos            erlang-solutions            915 k
 erlang-observer                 x86_64          20.3-1.el7.centos            erlang-solutions            980 k
 erlang-odbc                     x86_64          20.3-1.el7.centos            erlang-solutions             87 k
 erlang-orber                    x86_64          20.3-1.el7.centos            erlang-solutions            1.1 M
 erlang-os_mon                   x86_64          20.3-1.el7.centos            erlang-solutions            135 k
 erlang-otp_mibs                 x86_64          20.3-1.el7.centos            erlang-solutions             33 k
 erlang-parsetools               x86_64          20.3-1.el7.centos            erlang-solutions            208 k
 erlang-public_key               x86_64          20.3-1.el7.centos            erlang-solutions            689 k
 erlang-reltool                  x86_64          20.3-1.el7.centos            erlang-solutions            404 k
 erlang-runtime_tools            x86_64          20.3-1.el7.centos            erlang-solutions            253 k
 erlang-sasl                     x86_64          20.3-1.el7.centos            erlang-solutions            342 k
 erlang-snmp                     x86_64          20.3-1.el7.centos            erlang-solutions            1.9 M
 erlang-ssh                      x86_64          20.3-1.el7.centos            erlang-solutions            630 k
 erlang-ssl                      x86_64          20.3-1.el7.centos            erlang-solutions            969 k
 erlang-stdlib                   x86_64          20.3-1.el7.centos            erlang-solutions            3.2 M
 erlang-syntax_tools             x86_64          20.3-1.el7.centos            erlang-solutions            493 k
 erlang-tools                    x86_64          20.3-1.el7.centos            erlang-solutions            638 k
 erlang-typer                    x86_64          20.3-1.el7.centos            erlang-solutions             28 k
 erlang-wx                       x86_64          20.3-1.el7.centos            erlang-solutions            4.7 M
 erlang-xmerl                    x86_64          20.3-1.el7.centos            erlang-solutions            1.1 M
 mesa-libGLU                     x86_64          9.0.0-4.el7                  rhel-7-server-rpms          196 k
 unixODBC                        x86_64          2.3.1-11.el7                 rhel-7-server-rpms          413 k
 wxBase                          x86_64          2.8.12-20.el7                epel                        588 k
 wxGTK                           x86_64          2.8.12-20.el7                epel                        2.9 M
 wxGTK-gl                        x86_64          2.8.12-20.el7                epel                         34 k

Transaction Summary
================================================================================================================
Install  1 Package (+54 Dependent packages)

Enjoy your leading edge toochain !

[jani@red ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.5 (Maipo)
[jani@red ~]$ erl
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.3  (abort with ^G)
1>

RabbitMQ installation instructions says it's a good idea to lock installed erlang version. See How to restrict yum to install or upgrade a package to a fixed specific package version?

[root@red ~]# yum -y install yum-plugin-versionlock
[...]
[root@red ~]# yum versionlock erlang wxBase wxGTK wxGTK-gl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock
Adding versionlock on: 0:wxGTK-2.8.12-20.el7
Adding versionlock on: 0:wxGTK-gl-2.8.12-20.el7
Adding versionlock on: 0:wxBase-2.8.12-20.el7
Adding versionlock on: 0:erlang-20.3-1.el7.centos
versionlock added: 4
[root@red ~]#