I’ve finally put together a bash script to automatically download, compile and install Mono on Ubuntu. At the time of writing, it installs Mono 2.4.2.3. Should this be outdated by the time you read this, you can simply modify the install script to download the latest files.

A word of warning: This script will remove any previous installations of Mono done via apt-get or Synaptic. This means that existing Mono applications may cease to function or be removed entirely. I would suggest only running this on Ubuntu Server, where visual apps aren’t an issue.

First, make sure you’re running with root privileges:


$ sudo bash

Then let’s download the script from my blog:


$ wget http://blog.ruski.co.za/files/install-mono.sh

Before we can execute the script, we need to give the file execute permissions:


$ chmod 700 install-mono.sh

Now we can execute the script:


$ ./install-mono.sh

The script will now go off and do all the bits that it needs to install Mono. This may take a good couple of minutes.

For those who’re interested, the contents of the script is below:


#!/bin/bash
apt-get remove mono-common
apt-get update
apt-get install build-essential pkg-config libglib2.0-dev bison libcairo2-dev libungif4-dev libjpeg62-dev libtiff4-dev gettext apache2-threaded-dev
mkdir /src
mkdir /src/monoscript
cd /src/monoscript
wget http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.2.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.4.2.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.4.2.tar.bz2
tar -xvf libgdiplus-2.4.2.tar.bz2
tar -xvf mono-2.4.2.3.tar.bz2
tar -xvf xsp-2.4.2.tar.bz2
tar -xvf mod_mono-2.4.2.tar.bz2
# compile libgdipluss
cd libgdiplus-2.4.2
./configure --prefix=/usr/local; make; make install
sh -c "echo /usr/local/lib >> /etc/ld.so.conf"
/sbin/ldconfig
# compile mono
cd ../mono-2.4.2.3
./configure --prefix=/usr/local; make; make install
# compile xsp
cd ../xsp-2.4.2
./configure --prefix=/usr/local; make; make install
# compile mod_mono
cd ../mod_mono-2.4.2
./configure --prefix=/usr/local; make; make install

You will still need to configure apache2, so use the rest of the instructions on this page: Install Mono 2.4 on Ubuntu

If you have any issues with the script, let me know in the comments.

Comments

Maiko
Maiko
Mon, 19 Oct 2009 #

Hi, how can I start the IDE after the run this script ?

Bye.

Mon, 19 Oct 2009 #

Maiko, you will need to install Mono develop from source after installing using this method. I would suggest searching google for details on how to do that.

bellak
bellak
Mon, 2 Nov 2009 #

Hi ,
sorry , can you tell me how to install MonoDevelop 2.2 from sources in ubuntu 9.10 please?
sorry i'm null in linux , and sorry my bad English
thank you

Mon, 2 Nov 2009 #

Bellak, I've never personally been able to get MonoDevelop to work on Ubuntu, so I can't really help you out there. I develop on Windows and deploy to Linux hosts, so MonoDevelop is luckily not that important to me.

You can try the instructions here: synpl.blogspot.com/.../...nd-monodevelop-from.html

If you do manage to get it figured out, please let me know!

bellak
bellak
Mon, 2 Nov 2009 #

Hi ,
Thank you for the answer , but how can we be sure that it works under ubuntu ?
another small question , can we create the Silverlight 3 and WCF projects on Windows and deploy to linux ??
Thank you

Wed, 4 Nov 2009 #

From the internet I gather that monodevelop does work on Ubuntu. In fact, it is bundled with it. The only problematic area is upgrading your Mono version by compiling from source.

As for WPF, I don't believe that Mono has any current plans to support it. See this page: http://www.mono-project.com/WPF

Silverlight 3 may very well be supported with Moonlight. I suggest you do some further research on Google.

bellak
bellak
Wed, 4 Nov 2009 #

thank you Russel , but my question is for WCF not WPF .
and if I develop a project Silverlight 2 how can i sure that it works in Linux (Moonlight).

Thu, 5 Nov 2009 #

Bellak, I don't know how you can be sure that it will work other than testing it yourself and/or reading up about it on the internet.

Comments are closed

I am a software developer / architect currently interested in combining .NET technologies with open-source operating systems. 

I am a member of the open-source BlogEngine.NET development team and focus mainly on ensuring Mono compatibility for the project.

twitter


At StayUnlimited Cape Town accommodation we help you choose from and book guest houses, self catering apartments, bed & breakfasts, luxury villas and hotel accommodation.