Installing Mono Trunk or 2.6.4 Tag with Subversion Source on Ubuntu 10.04 Lucid
Updated June 23, 2010!
Lately, I’ve been really digging the new Ubuntu 10.04 on my desktop and web server. So I’ve been meaning to get a post out here describing how I got Mono trunk installed since it comes packaged with 2.4.4. After much testing, I finally have finished getting a script to work with a fresh, vanilla install.
I stumbled on this blog post by Boris Schieman where he wrote a bash script to compile and install the Mono trunk. I made a few tweaks to it for a vanilla linux install for the tagged 2.6.4 release and setup another one for updating a mono trunk build using the daily tarballs. I’ve successfully tested both versions on Ubuntu 10.04 Lucid. I’m just a casual linux/mono user, so use this at your own risk.
Steps to Install
Starting with a fresh install of Ubuntu 10.04 Server, these steps can be run from the console or via SSH. Lately, I’ve been testing the trunk script more thoroughly than the tagged version, but they both should work. As always, checkout http://www.mono-project.com to get more detailed information about the different versions available and this install process. For the tagged 2.6.4 install, I chose to use the packaged mono to support compiling this one; so when it’s done, you’ll end up with two versions of mono installed. The packaged version is 2.4.4 located at: /usr/bin and this compiled version will be located at /usr/local/bin and should be the default after it’s installed. These steps are basically the same for both versions. Just switch out the url for the script if you want to install the 2.6.4 tag.
Step by Step
- Create a new directory in your home directory called mono.
mkdir mono
cd mono - Copy the script to this folder and make it executable
wget http://www.integratedwebsystems.com/resources/p796/install_mono-trunk.sh
chmod 744 install_mono-trunk.sh - Execute it. (without sudo; you will be prompted occasionally for your sudo password during install phases)
./install_mono-trunk.sh - Check the install – sometimes the trunk doesn’t always compile fully or install correctly. Check your /usr/local/bin folder to see what was installed. You can also run mono –V to see the current runtime version, which should be the date of the tarball 20100618, etc. (equivalent of 2.7 trunk)
ls /usr/local/bin - Setup Mod_Mono by moving the config file and enabling it for apache
sudo mv /etc/apache2/mod_mono.conf /etc/apache2/mods-available
sudo ln -s /etc/apache2/mods-available/mod_mono.conf /etc/apache2/mods-enabled/mono.conf - Check your apache site configurations to ensure they’re using the correct path to mod-mono-server2 located at /usr/local/bin. I use the mod_mono configuration tool and then change the path it generates. Restart Apache when you’re done.
sudo service apache2 restart
Download Scripts
Install Mono Trunk (updated 2/26/2010)
Update Mono Install (updated 2/26/2010)
Install Script for Trunk
#!/bin/bash TOPDIR=$(pwd) BUILDDIR=$TOPDIR/build DLDDIR=$TOPDIR/downloads export PATH=/usr/local/bin:$PATH echo "updating existing system" sudo apt-get update sudo apt-get upgrade -y echo "installing prerequisites" sudo apt-get install -y build-essential libc6-dev g++ gcc libglib2.0-dev pkg-config subversion apache2 apache2-threaded-dev bison gettext autoconf automake libtool mkdir -p $BUILDDIR echo echo "downloading mono packages" echo cd $BUILDDIR svn co svn://anonsvn.mono-project.com/source/trunk/xsp svn co svn://anonsvn.mono-project.com/source/trunk/mod_mono wget http://mono.ximian.com/daily/mono-latest.tar.bz2 wget http://mono.ximian.com/daily/monocharge-latest.tar.gz cd $BUILDDIR bunzip2 -df mono-latest.tar.bz2 tar -xvf mono-latest.tar tar -xzvf monocharge-latest.tar.gz echo echo "building and installing mono packages" echo cd $BUILDDIR cd mono-* ./configure --prefix=/usr/local --with-glib=system make sudo make install cd $BUILDDIR cd monocharge* sudo env prefix=/usr/local ./recharge.sh cd $BUILDDIR cd xsp ./autogen.sh --prefix=/usr/local make sudo make install cd $BUILDDIR cd mod_mono ./autogen.sh --prefix=/usr/local make sudo make install cd $BUILDDIR echo echo "done"
Good luck!



I just installed the trunk using the nightly build. That is 100x simpler than doing the trunk build from SVN. I’ll update the trunk installer script to do this. See http://mono-project.com/Compiling_Mono_From_Tarball for details.
The trunk install script is updated and works! It will pull the latest tarball trunk build with the trunk svn code for xsp and mod_mono. I tested it on a fresh ubuntu server 10.04 install. I’ll update the ‘update’ script soon.
Again, I updated the scripts. I noticed that the past few daily releases didn’t compile very easily. I updated the scripts to use the June 18th version, which is the most recent version that works using these scripts. I’ll keep an eye on it and update the scripts as new versions come out.
You can always see the most recent script here at our subversion repository for the site.
http://github.com/nathanb/iws-snippets/tree/master/mono-install-scripts/ubuntu/
I just updated the scripts to use the daily build from August 1st, 2010. I also added a script for Fedora 13. I’ve tested the install but not the web server. All appears okay. You can get the most recent versions of these from my subversion repository linked in the previous comment.
http://www.integratedwebsystems.com/resources/p796/fedora_mono-trunk.sh
Hi Nathan;
This is a great tool, thanks!
I appreciate your hard work,
Dale
Comment #3′s link to the repository fails for me. But I get there with
http://github.com/nathanb/iws-snippets/tree/master/mono-install-scripts/ubuntu/.
I’m not getting anything in /usr/local/bin. I’ve been using
sudo ./install_mono-trunk.sh >t3.log 2>>t3.log
(I added the logging to see what I was doing wrong and to look for errors.)
And since I’m wandering around messing things up and running things twice and more I skipped the download in install_mono-trunk.sh with:
mkdir -p $BUILDDIR
cd $BUILDDIR
if [ -e mono-20100901.tar ]
then
echo mono-20100901.tar exists, download skipped
else
echo mono-20100901.tar does not exist
echo
echo “downloading mono packages”
echo
svn co svn://anonsvn.mono-project.com/source/trunk/xsp
svn co svn://anonsvn.mono-project.com/source/trunk/mod_mono
wget http://mono.ximian.com/daily/mono-20100901.tar.bz2
bunzip2 -df mono-20100901.tar.bz2
tar -xvf mono-20100901.tar
fi
@Dale E. Moore
You bet! I’ve updated this post more frequently that it shows. There should be one out there from Sept 1st. I found that sometimes the -latest builds don’t work, so I’ve been testing them and pushing out a script with the latest tested build.
Thanks!
@Dale E. Moore
Hey sorry, I ddin’t see your second comment. I’ve noticed while doing this over and over, that if you attempt to install multiple times and it fails, the uninstall script appears to cleanly remove everything. It also doesn’t duplicate stuff (like a windows install might). The make install script just copies files around like a batch file would. As long as you keep using the same –prefix, you should be pretty safe. When I was testing, I usually deleted the root build directory before re-running the script. Let me know if you keep having problems with that. I was just testing it with a small console-only VM.