How do I install a specific version of Erlang/OTP?

后端 未结 6 1526
执笔经年
执笔经年 2021-01-12 05:06

I have inherited a project with a puppet/vagrant/Virtual box setup. The vagrant provision is breaking around my erlangs surrounding rabbitmq-server.

the error:

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-12 06:02

    1. Remove previous Erlang versions/packages:

    $ sudo apt-get purge erlang esl-erlang erlang-base erlang-crypto erlang-eldap erlang-inets erlang-mnesia erlang-os-mon
    $ sudo apt-get autoremove
    $ sudo apt-get install -f
    
    $ sudo rm -rf /usr/lib/erlang
    $ cd /usr/local/bin
    $ sudo rm -f erl
    $ sudo rm -f erlc
    $ sudo rm -f epmd
    $ sudo rm -f run_erl
    $ sudo rm -f to_erl
    $ sudo rm -f dialyzer
    $ sudo rm -f typer
    $ sudo rm -f escript
    $ sudo rm -f ct_run
    

    2. Add the repository entry manually:

    • To get Ubuntu codename type $ lsb_release -c. In my case it's xenial.

    • $ sudo nano /etc/apt/sources.list and add following text at the end of the file:

    # Erlang Solutions
    deb https://packages.erlang-solutions.com/ubuntu xenial contrib
    
    • Create a file /etc/apt/preferences.d/erlang :
    $ sudo touch /etc/apt/preferences.d/erlang
    $ sudo nano /etc/apt/preferences.d/erlang
    

    with the following contents:

    Package: erlang* esl-erlang
    Pin: version 1:21.3*
    Pin-Priority: 501
    

    where 21.3 is the version of Erlang/OTP.

    3. Install Erlang:

    $ sudo apt-get update
    $ sudo apt-get install esl-erlang
    $ sudo ln -s /usr/lib/erlang/bin/erl /usr/local/bin/erl
    

    4. Check installed Erlang version:

    $ erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell
    

    Related link: https://www.erlang-solutions.com/resources/download.html

提交回复
热议问题