Tuesday, October 28, 2008

Compiling Mono 2.0.1 on Ubuntu Gutsy Server 8.04

I didn't want to use the aging Mono version present in Ubuntu Server 8.04, so I set out to compile Mono 2.0 (and subsequently 2.0.1, via the same process). This turned out not to be too bad.

First, install the requisite packages:
aptitude install build-essential swig autoconf gawk mono-common binfmt-support bison pkg-config libglib2.0-dev
Yes, that's not a typo--you do want one of Ubuntu's Mono packages, mono-common. This will enable shell execution of Mono executables via ./ notation rather than having to execute "mono /path/to/executable."

Once you are done, download and unpack the source for Mono. This will get you 2.0.1:
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.0.1.tar.bz2
tar xf mono-2.0.1.tar.bz2

Now you are ready to build and install Mono (the make step will take a while):
cd mono-2.0.1
./configure --with-libgdiplus=no
make
make install
Lastly, you need one symlink so the binfmt-support package can execute Mono executables directly via the shell:
ln -s /usr/local/bin/mono /usr/bin/cli
That's it. Typing the command "mono -V" should yield the about information for Mono 2.0.1. Follow the instructions under "Testing the Mono installation" and confirm you can not only build and execute the example.exe application, but that you can execute it with ./ notation (e.g. ./example.exe).

Cheers!

2 comments:

  1. Worked like a Charm on Unbuntu 8.10 with Mono 2.2
    Thanks !

    ReplyDelete
  2. Works fine with Mono 2.8 on Ubuntu 8.10. Last step is not needed.

    ReplyDelete