1 Ubuntu系统安装Erlang
安装1:24.1.5-3版本erlang
mkdir erlang
cd erlang
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install esl-erlang=1:24.1.5-3
如果执行完sudo apt-get install esl-erlang=1:24.1.5-3发现找不到对应的版本执行以下命令查看已有的版本
apt-cache policy esl-erlang
如果没有所需版本执行下面的命令更新仓库
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
echo "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list
sudo apt update
再次执行sudo apt-get install esl-erlang=1:24.1.5-3
如果没有完全匹配的版本至少保证大版本相同
2 Centos环境下安装Erlang
使用yum安装erlang
wget https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm
sudo rpm -Uvh erlang-solutions-2.0-1.noarch.rpm
sudo rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
设置erlang源
#创建erlang_solutions.repo文件
sudo vim /etc/yum.repos.d/erlang_solutions.repo
并添加内容
[erlang-solutions]
name=CentOS $releasever - $basearch - Erlang Solutions
baseurl=https://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
gpgcheck=1
gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1
安装
sudo yum install erlang
3 查看erlang是否安装成功
输入erl
显示erlang版本信息证明erlang安装成功