After lots of searching and fidgeting, I finally got Mono built from source and running in Ubuntu (14.04 as of the writing of this post). This post serves as a walk-through of the steps, and a reference for myself and anyone else who may be looking to do the same.

Update: 07/24/14: I have updated this for Ubuntu 14.04 and Mono 3.6.x

Installing Dependencies

First, we need to install all the dependencies we will need.

sudo apt-get install git autoconf automake libtool g++ gettext mono-gmcs

You will also need the dev versions of some more libraries.

sudo apt-get install libglib2.0-dev libpng12-dev libx11-dev
sudo apt-get install libfreetype6-dev libfontconfig1-dev
sudo apt-get install libtiff5-dev libjpeg8-dev libgif-dev libexif-dev

Cloning source code repositories

Now, lets get all the code we will need. The Mono project has all of their source code on their GitHub account. You want to create a folder in /opt or your home folder to contain your working source code repositories. Clone the repositories while inside this folder.

git clone git://github.com/mono/mono.git
git clone git://github.com/mono/libgdiplus.git

libgdiplus is needed by Mono.

Compiling

Compiling libgdiplus

Navigate to the root folder of the libgdiplus repository you cloned previously, and then run the following commands.

./autogen.sh --prefix=/usr/local

This will configure the compilation process and ensure your computer has all the proper libaries and dependencies installed. If you ran everything above, you should be good to go. If it fails on an error and indicates you are missing a libary or package, you may need to install a development version of that package, and then try to run the command again.

Once this completes successfully and you see the words Now type 'make' to compile, you can run the following commands.

make
sudo make install

make will compile the package, and sudo make install will install it into your system. If you get an error trying to run make, there is a bug in the tests when running under Ubuntu 13.04. The workaround at this link worked for me. https://github.com/nathanb/iws-snippets/issues/9. libgdiplus is now installed, and we are ready to move on to Mono.

Compiling Mono

First you need to get all the submodules for Mono:

git submodule init
git submodule update --recursive

Now navigate to the directory where you cloned the Mono source code. Run the compilation setup script similar to the previous step

./autogen.sh --prefix=/usr/local

Once this completes successfully and you should again see the words Now type 'make' to compile. This article assumes you do not already have Mono installed. You must first make monolite, which is then used to build the full Mono.

make get-monolite-latest

Now you can build Mono:

make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe

If you already have a working Mono installation, or you want to update it you can just run regular make without having to build monolite.

Now you can install it:

sudo make install

You can optionally run make check to run the mono and mcs test suites.

That's it! You should now have a working Mono installation on your system. You can now run:

mono -V

You should see some information on Mono and the version number. As of the time of this writing, that is 3.6.1.