Install Mono 2.6.x parallel environment on Ubuntu 9.10
IMPORTANT DATE : 04 Feb 2011
I have released an updated version which supports mono 2.10 (and previous versions) updated post version
Old article…
UPDATE: I have released an updated version which uses new git repos here
This is a simple work in progress to make the process a bit easier. There are many good reasons not to follow various scripts on the internet that install mono over the top of your packaged distribution install. The fact the Mono 2.6 isn’t released yet is an overriding one because any application depending on mono might stop working, Banshee, Tomboy, F-Spot, etc
At the moment this scripts only supports Mono 2.6 branch + Ubuntu 9.10, see the TODOs! It will install mono into /opt/mono-2.6 and checkout & build in ~/mono-src/mono-2.6. Run it again to update your working copy and rebuild/install.
Please let me know if you like/hate/improve the script
Download script here http://patrick.qmtech.net/downloads/mono_parallel.sh
You will need these packages installed: build-essential automake libtool gettext mono-devel mono-1.0-devel subversion libpng-dev libtiff-dev libgif-dev libjpeg-dev libexif-dev autoconf automake bison flex libcairo2-dev libpango1.0-dev
If you’re looking for more than a DIY script my company QMTech offers commercial support for mono, please contact info@qmtech.net / +44 (0) 161 660 2690 for details.
UPDATE (Thanks Ben): If you’re doing this on a server (no Firefox) you will also need to install: libxul-dev
UPDATE (7/FEB/10): Updated the package requirements
UPDATE (4/MAR/10): Updated the package requirements (added mono-1.0-devel, libcairo2-dev)
UPDATE (20/MAR/10): reworded to reference 2.6 branch not specific 2.6.1
It seems that I need to install the package “libpango1.0-dev” instead of “libpango-dev” as you mentioned.
1. install the package “libpango1.0-dev” instead of “libpango-dev”
2. package “libxul-dev” conflict with “firefox-3.5″
3. package “automake” repeat twice
Note: For workstation installation, you need to edit the script to get mono-tools
gluezilla is not included for workstation installations. this also requires package libgtk2.0-dev
It seems like it is OK to reinstall Firefox after building mono (not sure if gluezilla works then though…)
I do have a problem with locale with this build. The date formats etc are no longer correct (they are by default with Mono 2.4.2.3 on Ubuntu 9.10).
Thank you for this tuto. How do you tell nant to use this version of mono instead of the one of Ubuntu ?
Thanks for the script – I receive an error “MI ERROR: Checking out libgdiplus failed”
Do you have subversion installed?
I do not
You need to run something like
Works! Thanks.
Many thanks, Patrick. That worked like a charm.
Just ran the script. Looks like you should change the “libcairo-dev” package to “libcairo2-dev”. Is that right?
Thanks for posing the script. Once I got the ubuntu dependancies sorted things seemed to be going OK but now I am having problems with a compilation failure (see below). I’m sure I’ve just got some config wrong but not sure what to change. I tried adding PROFILE=net_2_0 to make install this didn’t fix the issue.
Thanks in advance
Neil
MCS [net_1_1] monodoc.dll
Monodoc/provider.cs(25,1): warning CS0105: The using directive for `System.Text.RegularExpressions’ appeared previously in this namespace
Monodoc/provider.cs(20,19): (Location of the symbol related to previous warning)
Monodoc/provider.cs(887,98): error CS1644: Feature `generics’ is not supported in Mono mcs1 compiler. Consider using the `gmcs’ compiler instead
Compilation failed: 1 error(s), 1 warnings
No it’s not just you. I’m seeing this too, I will investigate tomorrow!
Looks like it’s been fixed yesterday…
That worked for me perfect. Thanks!
Thanks for the script.
I can’t seem to be able to build any gtk# applications using this environment. Any idea how I can add gtk# to it?
Arg… getting more than a little frustrated…
Thanks for the script Ben. I was able to install a parallel Mono 2.6 on my Ubuntu 9.10, but this patch:
https://bugzilla.novell.com/show_bug.cgi?id=346561
;is STILL not implemented.
How am I expected to handle SSL validation of a WebService from my CLI client? None of the security faqs on the mono site work. The only reason I’m using mono is for cross platform usability, and that I like C#. certmgr doesn’t help with the SSL/TLS auth failures, while the same code, no matter the approach to handling this works on Windows .Net 2.0. I’ve read ALL the boards, FAQs and bug cases. People are clearly not using Mono for SSL protected CLI client apps, but for hosted WebServices or non-SSL interfaces.
Either way, thanks for the script.
Thanks a lot for the script. It’s so helpful!
Doesn’t seem to work on Ubuntu 9.10 Server (fairly clean install):
if test -w ../../mcs; then :; else chmod -R +w ../../mcs; fi
cd ../../mcs && make NO_DIR_CHECK=1 PROFILES=’net_1_1 net_2_0 net_3_5 net_2_1_raw ‘ CC=’gcc’ all-profiles
make[3]: Entering directory `/home/brad/mono-src/mono-2.6/mcs’
make profile-do–net_1_1–all profile-do–net_2_0–all profile-do–net_3_5–all profile-do–net_2_1_raw–all
make[4]: Entering directory `/home/brad/mono-src/mono-2.6/mcs’
make PROFILE=basic all
make[5]: Entering directory `/home/brad/mono-src/mono-2.6/mcs’
make[6]: Entering directory `/home/brad/mono-src/mono-2.6/mcs’
mkdir -p — build/deps
make[6]: mcs: Command not found
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
make[6]: Leaving directory `/home/brad/mono-src/mono-2.6/mcs’
*** The compiler ‘mcs’ doesn’t appear to be usable.
*** You need a C# 1.0 compiler installed to build MCS (make sure mcs works from the command line)
*** mcs/gmcs from mono > 2.6 will not work, since they target NET 2.0.
*** Read INSTALL.txt for information on how to bootstrap a Mono installation.
Ah! Figured out the “The compiler ‘mcs’ doesn’t appear to be usable.” problem:
sudo apt-get install mono-1.0-devel
(I also had to use libcairo2-dev as mentioned above)
Cheers Brad, I have updated the package requirements
What’s wrong with mozroots? Something like…
I will add this into the script, in the meantime…
How can i target this environment in monodevelop? I want to try out the new soft-debugger and so on.
@david I run MD from the trunk all the time, try this…
Run it with…
Hi there,
thank you for your nice script, but apt-get pointed out that libtiff-dev is a virtual package and I should use a proper one which is libtiff4-dev for example.
Well okay I used in on an Ubuntu 9.04 Server so I shouldn’t be complaining…
But it failed building Mono with:
decl.cs(628,57): error CS0246: The type or namespace name `var’ could not be found. Are you missing a using directive or an assembly reference?
MI ERROR: mono failed
Hi,
why is mono-1.0-devel instead of mono-2.0-devel required? Where is the difference in these packages?
Hi,
I have Ubuntu 10.4 with Mono 2.4 package installed… but need 2.6 for some wcf stuff :/
is this script working for Ubuntu 10.4 as well? Anyone tried this?
Hey Marc,
I’m trying it now. I’m not a *nix wizard though so if I get stuck I’ll probably get totally stuck!
Will post back if I make any progress.
Hi ,
tanx for the great article..currently using it to install mono 2.6.4 and monodevelop..Also installed the gtk# libraries using the steps U outlined.mono also installed perfectly but I seem to be having a problem with monodevelop.Using the steps u specified I get an error during the configuration stage. The error is “Mono addins gui missing”..Can u help??
I’m running Ubuntu 10.04 Lucid.. tanx in advance
Hey, thanks for the script, I, for one, found it very useful. But I have one question, though: what if you’d add a ‘sudo apt-get updade’ line before starting the svn checkout to install all the needed dependencies? I mean, it couldn’t hurt, could it?
Hi,
Nice script
It’s possible to add -j N to make command to make the build process faster on MultiCore CPU?
Using this script I managed to build monodevelop and mono 2.6. Instructions are published on
@xiamx I haven’t seen anyone doing this for mono, try it
Got something nice like this for Mono 2.8?
I made some mods to build mono 2.8 on maverick. This isn’t fully tested for 2.6.7 or trunk, and there is one quirk with XSP that is noted in the comments at the top, but other than that it builds a fairly complete monodevelop environment.
#!/bin/bash
#
# Version 0.1
# This script is to install a parallel mono environment with ease
# It only checks out/installs mono 2.6 branch on Ubuntu 9.10 atm
#
# Copyright 2009 (c) QMTech Ltd (http://www.qmtech.net)
# Authors: Patrick McEvoy (firegrass) patrick@qmtech.net
# Contributions from Dan Quirk,
# This is free script under GNU GPL version 3.
# Modified by William F. Cook for use at DRS AMTC to build full monodevelop environment
# DRS Notes:
# * LLVM is built but not loaded by default. Modify mono-2.8 & mono-2.8-env
# with the “export MONO_USE_LLVM=1″ in order to turn it on by defalut
# * mono is built mostly default options. You may want to add
# –enable-big-arrays or other options
#
#
# To get XSP to build, you may first have to modifi ./mono-src-$VERSION/xsp/docs/makefile.am
# to change:
#
# INSTALLATION_DIR=$(shell pkg-config monodoc –variable=sourcesdir)
#
# to:
#
# INSTALLATION_DIR=/opt/mono-2.8/lib/monodoc/sources
#
# I’m working on that…
#
# Config
#
#default version is trunk. Also supported is “2.8″
VERSION=trunk
#option -s skips updating files from github
skipupdate=
skipbuild=
pauseflag=
inpvar=
ECHO_PREFIX=”—- ”
GIT_MODULES=”libgdiplus llvm mono gtk-sharp xsp mod_mono”
while getopts ‘abm:ptuv:’ opt
do
case $opt in
a) GIT_MODULES=”libgdiplus llvm mono gtk-sharp xsp mod_mono mono-basic mono-addins gtkmozembed-sharp webkit-sharp gluezilla gnome-sharp gnome-desktop-sharp mono-tools debugger monodevelop”
echo “$ECHO_PREFIX Building all”
;;
b) skipbuild=1
echo “$ECHO_PREFIX Skipping build”
;;
m) GIT_MODULES=”$OPTARG”
echo “$ECHO_PREFIX Building $GIT_MODULES”
;;
p) pauseflag=1
echo “$ECHO_PREFIX Pausing before configure/make/install steps”
;;
t) GIT_MODULES=”mono-basic mono-addins gtkmozembed-sharp webkit-sharp gluezilla gnome-sharp gnome-desktop-sharp mono-tools debugger monodevelop”
echo “$ECHO_PREFIX Building mono development tools”
;;
u) skipupdate=1
echo “$ECHO_PREFIX Skipping source code update”
;;
v) VERSION=$OPTARG
echo “$ECHO_PREFIX Building version $VERSION”
;;
?) printf “Usage: build_mono_parallel -v version [-s] [-t]“;;
esac
done
# TODO: webserver/server/workstation (+mod_mono,-gnome,-mono-tools/-gnome,-mono-tools/-mod_mono)
WORKING_DIR=~/mono-src-$VERSION
#
# WARNING: Don’t change stuff after here unless you’re sure….
#
echo “$ECHO_PREFIX Copyright 2009 (c) QMTech Ltd (http://www.qmtech.net)”
echo “$ECHO_PREFIX Authors: Patrick McEvoy (firegrass) patrick@qmtech.net”
echo “$ECHO_PREFIX Contributions from Dan Quirk,⋅Stefan Forster”
echo “$ECHO_PREFIX This is free script under GNU GPL version 3.”
MONO_PREFIX=/opt/mono-$VERSION
GNOME_PREFIX=/usr
echo “$ECHO_PREFIX This script will install dependencies and checkout mono and install in a parallel environment.”
echo “$ECHO_PREFIX Report bugs to patrick@qmtech.net, firegrass on twitter, carrier pidgeon etc”
# install dependencies
sudo apt-get install build-essential automake libtool gettext gawk intltool \
libpng-dev libtiff-dev libgif-dev libjpeg-dev libexif-dev autoconf automake \
bison flex libcairo2-dev libpango1.0-dev git-core libatk1.0-dev libgtk2.0-dev \
libglade2-dev libgnomecanvas2-dev libgnome2-dev libgnomeui-dev \
libpanel-applet2-dev libgnomeprint2.2-dev libgnomeprintui2.2-dev libgtkhtml3.14-dev libgtksourceview2.0-dev libnautilus-burn-dev librsvg2-dev libvte-dev libwncksync-dev \
libnspr4-dev libnss3-dev libwebkit-dev xulrunner-dev \
apache2-threaded-dev \
-y
# you really shouldn’t be doing this as root, you know…
if [ "$(id -u)" = "0" ]; then
read -p “$ECHO_PREFIX WARNING: You are root, this means your git clones will be owned by root. Enter to continue, Ctrl+C to exit” inpVar
fi
echo “$ECHO_PREFIX I am installing mono version $VERSION, building in $WORKING_DIR”
echo “$ECHO_PREFIX I need sudo access to install mono to /opt and mono-$VERSION in /usr/local/bin”
sudo echo “$ECHO_PREFIX If the sudo time limit is reached you will need to enter you password again.”
# making a dir to work from
mkdir -p $WORKING_DIR
cd $WORKING_DIR
# git path for mono sources
GIT_BASE=http://github.com/mono
if [ "$skipupdate" ]; then
echo “$ECHO_PREFIX Skipping source update.”
else
# svn modules to get
# check it all out or update
for mod in $GIT_MODULES; do
if [ "$VERSION$mod" == "2.6.7llvm" ]; then
echo “$ECHO_PREFIX skipping LLVM for this version”;
elif [ -d $mod ]; then
echo “$ECHO_PREFIX Updating $mod”
cd ${mod}
git pull || { echo “$ECHO_PREFIX ERROR: Updating $mod failed, you will need to manually ‘git clean -df’”; exit 1; }
cd ..
else
echo “$ECHO_PREFIX Cloning $mod ($SVN_BASE/$mod)”
git clone ${GIT_BASE}/${mod}.git || { echo “$ECHO_PREFIX ERROR: Cloning $mod failed”; exit 1; }
# Configure version to use
if [ $VERSION == "trunk" ]; then
echo “$ECHO_PREFIX Setting branch to master”
echo “$ECHO_PREFIX $mod”
cd ${mod}
git checkout master
cd ..
elif [ $VERSION == "2.8" ]; then
echo “$ECHO_PREFIX Setting branch to 2.8″
echo “$ECHO_PREFIX $mod”
cd ${mod}
if [ $mod == "gtk-sharp" ]; then
git checkout –track -b gtk-sharp-2-12-branch origin/gtk-sharp-2-12-branch
elif [ $mod == "gnome-sharp" ]; then
git checkout master
elif [ $mod == "gluezilla" ]; then
git checkout –track -b mono-2-6-4 origin/mono-2-6-4
elif [ $mod == "webkit-sharp" ]; then
git checkout master
elif [ $mod == "gtkmozembed-sharp" ]; then
git checkout master
elif [ $mod == "gnome-desktop-sharp" ]; then
git checkout –track -b gnome-desktop-sharp-2-24-branch origin/gnome-desktop-sharp-2-24-branch
elif [ $mod == "mono-addins" ]; then
git checkout –track -b 0.5 origin/0.5
elif [ $mod == "monodevelop" ]; then
git checkout –track -b 2.4 origin/2.4
else
git checkout –track -b mono-2-8 origin/mono-2-8
fi
cd ..
elif [ $VERSION == "2.6.7" ]; then
echo “$ECHO_PREFIX Setting branch to 2.6.7″
echo “$ECHO_PREFIX $mod”
cd ${mod}
if [ $mod == "gtk-sharp" ]; then
git checkout –track -b gtk-sharp-2-12-branch origin/gtk-sharp-2-12-branch
elif [ $mod == "gnome-sharp" ]; then
git checkout master
elif [ $mod == "gluezilla" ]; then
git checkout –track -b mono-2-6-4 origin/mono-2-6-4
elif [ $mod == "webkit-sharp" ]; then
git checkout master
elif [ $mod == "gtkmozembed-sharp" ]; then
git checkout master
elif [ $mod == "gnome-desktop-sharp" ]; then
git checkout –track -b gnome-desktop-sharp-2-24-branch origin/gnome-desktop-sharp-2-24-branch
elif [ $mod == "mono-addins" ]; then
git checkout –track -b 0.5 origin/0.5
elif [ $mod == "monodevelop" ]; then
git checkout –track -b 2.4 origin/2.4
else
git checkout –track -b mono-2-6-7 origin/mono-2-6-7
fi
cd ..
fi
fi
done
fi
if [ "$skipbuild" ]; then
echo “$ECHO_PREFIX Skipping source update.”
else
# create enviroment files
cat > “mono-$VERSION-env” < “mono-$VERSION” < profiles/drs << EOF
main
extras/AspNetEdit
extras/GeckoWebBrowser
extras/WebKitWebBrowser
extras/MonoDevelop.Database
extras/MonoDevelop.Profiling
extras/MonoDevelop.AddinAuthoring
extras/MonoDevelop.CodeAnalysis
extras/MonoDevelop.Debugger.Mdb
extras/MonoDevelop.Debugger.Gdb
extras/PyBinding
EOF
./configure –profile=drs –prefix=$MONO_PREFIX
else
./autogen.sh –prefix=$MONO_PREFIX;
fi
if [ $pauseflag ]; then
read -p "Type 'x' to exit, press enter to make $mod." inpVar
if [ "$inpVar" == "x" ]; then
exit 1;
fi
else
echo "$ECHO_PREFIX Making $mod"
fi
make
if [ $pauseflag ]; then
read -p "Type 'x' to exit, press enter to install $mod." inpVar
if [ "$inpVar" == "x" ]; then
exit 1;
fi
else
echo "$ECHO_PREFIX Installing $mod"
fi
sudo make install || { echo "$ECHO_PREFIX ERROR: $mod failed";.cd ./ exit 1; }
cd ..
fi
done
fi
# Exit message
echo ""
echo "$ECHO_PREFIX Your parallel environment is installed"
echo "$ECHO_PREFIX To start a mono-$VERSION environment, run: source mono-$VERSION-env"
echo "$ECHO_PREFIX To use mono-$VERSION to run a cli app, run: mono-$VERSION (eg mono-$VERSION mono -V)”
echo “”
#read -p “Done.” inpVar
echo “Done”
There’s a bug in William F.’s script:
if [ "$skipbuild" ]; then
echo “$ECHO_PREFIX Skipping source update.”
else
# create enviroment files
cat > “mono-$VERSION-env” < “mono-$VERSION” < profiles/drs << EOF
main
extras/AspNetEdit
extras/GeckoWebBrowser
extras/WebKitWebBrowser
extras/MonoDevelop.Database
extras/MonoDevelop.Profiling
extras/MonoDevelop.AddinAuthoring
extras/MonoDevelop.CodeAnalysis
extras/MonoDevelop.Debugger.Mdb
extras/MonoDevelop.Debugger.Gdb
extras/PyBinding
EOF
./configure –profile=drs –prefix=$MONO_PREFIX
else
./autogen.sh –prefix=$MONO_PREFIX;
fi
Two else clauses doesn't seem to work . . . is there a fix?