在RHEL7上安装最新版本的Erlang

时间:2018-05-03 13:27:46

标签: erlang rhel7

我正在尝试安装最新版本(编写本文时版本为20.3)Erlang分发到RHEL7(确切地说是7.5版本)。

谷歌告诉我,Erlang Solutions https://packages.erlang-solutions.com/正在维护最新的Erlang发行版(谢谢!)

在那里,您还可以找到如何添加存储库的说明,以便可以使用包管理器安装Erlang:

  

使用存储库

进行安装      
      
  1. 添加存储库条目
  2.         

    要向系统添加Erlang Solutions存储库(包括用于验证已签名包的公钥),请调用以下命令:

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

但是,如果我运行命令(我以root身份运行rpm命令),则不会向yum repolist添加Erlang Solutions repo。 RHEL7与Centos有什么不同,还是指令有问题或我做错了什么?

Erlang Solutions repo(和安装说明)也可以从

引用

1 个答案:

答案 0 :(得分:1)

我找到了根本原因,并且能够从Erlang Solutions存储库安装Erlang。

根本原因是$releasever在RHEL中与Centos中的不同,因此不能使用该变量,但必须将其更改为硬编码值。

以下是如何设置yum的详细步骤,以便可以使用yum从Erlang Solutions和EPEL存储库安装Erlang及其依赖项。

添加以下Erlang Solutions存储库文件:

[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 ~]#

请注意,必须从

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

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

为Erlang所需的依赖性添加EPEL存储库(wxBase,wxGTK,wxGTK-gl):

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

Repolist现在看起来:

[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包可用!

[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 ~]#

最后,您可以使用yum -y install erlang安装Erlang。

安装了以下来自多个不同存储库的软件包:

================================================================================================================
 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)

享受你的领先优势!

[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安装说明says锁定已安装的erlang版本是一个好主意。见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 ~]#