- 安装kerl,https://github.com/kerl/kerl
$ curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
$ chmod a+x kerl
- 下载Erlang源码http://www.erlang.org/downloads
- 将下载好的源码,拷贝到Ubuntu路径: /root/.kerl/archives(没有,应该可以自己把路径建出来)
- 运行kerl安装命令,我这里下载了21.3版本(otp_src_21.3.tar.gz)
$ kerl build 21.3 21.3
- 可能会有下面的报错,这是缺少库
-
安装SSL ODBC库,安装完毕,继续执行上一步的命令
$ apt-get install libssl-dev
$ apt-get install unixodbc-dev
- Erlang build,此过程会耗费几分钟,最后显示successfully built就ok
$ kerl build 21.3 21.3
Verifying archive checksum...
Checksum verified (7cdd18a826dd7bda0ca46d1c3b2efca6)
Extracting source code
Building Erlang/OTP 21.3 (21.3), please wait...
Erlang/OTP 21.3 (21.3) has been successfully built
- 继续安装
$ kerl install 21.3 ~/kerl/21.3
Installing Erlang/OTP 21.3 (21.3) in /Users/sanmiguel/kerl/21.3...
You can activate this installation running the following command:
. /Users/sanmiguel/kerl/21.3/activate
Later on, you can leave the installation typing:
kerl_deactivate
- 激活安装环境
$ . /root/kerl/21.3/activate
- 查看版本,出现以下信息,安装成功
root@iZbp1f5pc8ac1vmt84bjvqZ:~/kerl# erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.3