Erlang‎ > ‎

How to Install Erlang on Ubuntu 10.10

How to install Erlang 14B02 on stock Ubuntu 10.10

Quick Install of Prerequisite Packages

Run these commands on the command line to do a quick install:

# for erlang

sudo apt-get install fop 
sudo apt-get install libncurses5-dev
sudo apt-get install openjdk-6-jdk
sudo apt-get install unixodbc-dev
sudo apt-get install g++
sudo apt-get install libssl-dev


# for wxwidgets used in erlang

sudo apt-get install libwxbase2.8
sudo apt-get install libwxgtk2.8-dev
sudo apt-get install libqt4-opengl-dev
sudo apt-get install libgtk2.0-dev

Download, extract, configure, make, install

cd ~/Downloads
wget http://www.erlang.org/download/otp_src_R14B02.tar.gz
tar -zxf otp_src_R14B02.tar.gz
cd  otp_src_R14B02
./configure
make
sudo make install

Should be ready to go now!

What happens at each step if the prerequisite packages are not installed first

If you download, extract and try to configure Erlang without installing the prerequisites first, this is what you will see:

./configure
...
configure: error: No curses library functions found
configure: error: /bin/bash '/usr/local/src/otp_src_R14B02/erts/configure' failed for erts

So now you do this:

sudo apt-get install libncurses5-dev

Now let's try it again:

./configure

....

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************

crypto         : No usable OpenSSL found
jinterface     : No Java compiler found
odbc           : ODBC library - link check failed
orber          : No C++ compiler found
ssh            : No usable OpenSSL found
ssl            : No usable OpenSSL found

*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************

wx             : wxWidgets not found, wx will NOT be usable

*********************************************************************
*********************************************************************
**********************  DOCUMENTATION INFORMATION  ******************
*********************************************************************

documentation  : 
                 fop is missing.
                 Using fakefop to generate placeholder PDF files.

*********************************************************************


ok that is better, but lets knock off some of these missing items.

Run the following at the command line:

sudo apt-get install fop 
sudo apt-get install openjdk-6-jdk
sudo apt-get install libssl-dev
sudo apt-get install unixodbc-dev
sudo apt-get install g++

./configure
....
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************

wx             : wxWidgets not found, wx will NOT be usable

*********************************************************************

ok - looking better

Now lets run these:

sudo apt-get install libwxbase2.8
sudo apt-get install libwxgtk2.8-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libqt4-opengl-dev

./configure

...
configure: creating ./config.status
...

ah, good nothing missing and no errors

time to run make

make

Ok that passed, now run make install:

sudo make install

Ok, now where is erlang going to run from:

which erl

/usr/local/bin/erl

good, this will override /usr/bin/erl (which the stock install has R13B03 as of Apr 22, 2011).

Now time to do a little test of erlang:

 erl
Erlang R14B02 (erts-5.8.3) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.8.3  (abort with ^G)
1> wx:demo().
{wx_ref,35,wxFrame,<0.34.0>}
2> 

If you get the wxErlang widgets panel, then things are probably ready to go.

It is left as an exercise to remove the old (stock) Erlang package from Ubuntu :)

Comments