Erlang环境安装

系统版本:CentOS Linux release 8.3.2011

Erlang版本:12.1

  • 方法一:
  1. 安装epel源

    # 下载新epel
    dnf install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
    
    # 替换地址
    sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
    sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
    
  2. 下载安装包

    wget --no-check-certificate https://github.com/rabbitmq/erlang-rpm/releases/download/v24.1.2/erlang-24.1.2-1.el8.x86_64.rpm
    
  3. 安装

    dnf install erlang-24.1.2-1.el8.x86_64.rpm
    
  4. 验证

    [root@i-h0xe1oiq tools]# erl -version
    Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.1.2
    
  • 方法二:
  1. 安装epel源

    # 下载新epel
    dnf install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
    
    # 替换地址
    sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
    sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
    
  2. 下载安装包

    wget --no-check-certificate https://erlang.org/download/otp_src_24.1.tar.gz
    
  3. 安装依赖

    dnf install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
    
  4. 解压

    tar xf otp_src_24.1.tar.gz -C /application/
    
  5. 进入目录

    cd /application/otp_src_24.1/
    
  6. 编译安装

    ./configure --prefix=/usr/local/erlang --with-ssl --enable-threads --enable-smp-support --enable-kernel-poll --enable-hipe --without-javac
    make && make install
    
  7. 配置环境变量

    [root@i-h0xe1oiq otp_src_24.1]# vim /etc/profile
    
    #set erlang environment
    ERL_PATH=/usr/local/erlang/bin
    PATH=$ERL_PATH:$PATH
    
    [root@i-h0xe1oiq otp_src_24.1]# source  /etc/profile
    
  8. 验证

    [root@i-h0xe1oiq ~]# erl -version
    Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.1
    
posted @ 2021-10-26 14:32  忘川的彼岸  阅读(659)  评论(0编辑  收藏  举报