OTP_GITHUB_URL="https://gitee.com/mirrors/erlang/repository" KERL_BUILD_BACKEND=git kerl build 19.3.6.13 19.3.6.13 Downloading OTP-19.3.6.13.tar.gz to /home/pwf/.kerl/archives % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 32.4M 0 32.4M 0 0 779k 0 --:--:-- 0:00:42 --:--:-- 2157k Extracting source code Building Erlang/OTP 19.3.6.13 (19.3.6.13), please wait... WARNING: It appears that a required development package 'libssl-dev' is not installed. APPLICATIONS DISABLED (See: /home/pwf/.kerl/builds/19.3.6.13/otp_build_19.3.6.13.log) * jinterface : No Java compiler found
DOCUMENTATION INFORMATION (See: /home/pwf/.kerl/builds/19.3.6.13/otp_build_19.3.6.13.log) * documentation : * xsltproc is missing. * fop is missing. * xmllint is missing. * The documentation can not be built.
Erlang/OTP 19.3.6.13 (19.3.6.13) has been successfully built
kerl install 19.3.6.13 ~/kerl/19.3.6.13 Installing Erlang/OTP 19.3.6.13 (19.3.6.13) in /home/pwf/kerl/19.3.6.13... You can activate this installation running the following command: . /home/pwf/kerl/19.3.6.13/activate Later on, you can leave the installation typing: kerl_deactivate
再在~/.bashrc增加一个alias:
1
alias erl19='. /home/pwf/kerl/19.3.6.13/activate && kerl active'
然后运行erl19,就可以用19版本的erlang了。
脚本
最后放个快速使用的脚本,
用法跟kerl一样,只是不用自己去设置环境变量了, gitee_kel.sh:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/env bash
export KERL_BUILD_BACKEND=git
case $1 in build) export OTP_GITHUB_URL="https://gitee.com/mirrors/erlang/repository" ;; *) export OTP_GITHUB_URL="https://gitee.com/mirrors/erlang" ;; esac