Ubuntu is developed on a 6 month rolling release cycle so even if you’re running the latest alpha, 11.04, natty, you still only get mono 2.6.7. If you want to target .NET 4 or simply want to use the latest version of Mono, then you’ll need to compile mono from source. My colleague, firegrass, has written a lovely script which does all the heavy lifting for you, you can pull the latest version here
https://github.com/firegrass/mono-installer-script
The script will ensure the correct dependencies are installed, check everything out from source, build in the correct order and importantly install all this in a parallel environment so that you still have access to the repo version of mono for applications like banshee, f-spot etc. You can even ask the script to pause after each install to review the progress. Aswell as the latest version of Mono you will get the Monodevelop trunk which includes support for git amongst other nice features.
If you clone the repo you can also keep up to date with bleeding edge changes, as the script is used inhouse almost daily to keep upto date with the latest from the Mono project. The script elegantly supports being rerun regularly to update your install. If a scenario is not covered pull requests and questions are more than welcome :)
Hallo Dan.
I’m running Ubuntu 10.10 and tried many times before to compile mono 2.8 or at least mono 2.10. So i was very pleased about your script. I’ve tried
mono_build.sh -a -v 2.10
but it stops at configure debugger with the message:
checking Whether your Mono is working… no
configure: error: *** Your Mono is too old for this version of the debugger.
Do you have any hints for me to solve this problem?
Link | February 20th, 2011 at 9:56 pm
I needed Mono 2.10 really much, but no just what you said they still ship only Mono 2.6.7, which is kinda out-dated.
I need to thank you sooooo much :D Good work, everybody need to write this kind of scripts for “bleeding edge” software for Linux.
This make it much easier to install the whole Mono software with Monodevelop application :)
Automatically get the packages, checks out the GIT repo including all the mono sources and compiles them for you just wonderfull.
Again thumbs up!
Kind regards,
Melroy
Ps.
I report problems later if there are any ;)
Link | February 20th, 2011 at 10:57 pm
@Thomas
Since Mono 2.6 there’s a new “SDB”
debugger built into the Mono runtime by default, which MonoDevelop 2.2 and later versions
support by default without any extra addins. You almost definitely want to be using this debugger. This module is just included for completeness sake at the moment. If you have got this far you mono environment is successfully installed, just let the script continue and make monodevelop.
Link | February 21st, 2011 at 11:53 am
First of all, thanks for the script, it looks like there’s been a lot of time spent on it!
Unfortunately, there seems to be a problem with it…
I get an error when it’s trying to compile mono-basic…. Saying that it can’t find “System.Xml.dll”…. not sure what mono-basic is (support for coding in VB.NET?)… but it doesn’t appear to work…
I then also get an error on the debugger…
checking for fgetln… no
configure: error: Cannot find termcap library
make: *** No targets specified and no makefile found. Stop.
– ERROR: debugger failed to compile, press enter to continue
Also, can you give me pointers on how I run stuff using the .NET 4 runtime? trying to get NUnit to run, my test projects are targetting .NET 4 and therefore won’t run unless NUnit is running using that runtime…
Thanks in advance for any help you can give…
Martin
Link | March 3rd, 2011 at 11:37 pm
@Martin,
Check the comment above about the debugger. As for mono-basic, yes it is for VB, we need to schedule some time to look into it, pull requests are welcome :)
Monodevelop comes with an nunit package, if you are running the MD trunk you will get access to a version of nunit which will work with .NET4
Link | March 8th, 2011 at 2:38 pm
Hi Dan,
I tried to run your script today and ended up with this:
– Making monodevelop
./mono_build.sh: line 372: ./autogen.sh: No such file or directory
Makefile:7: config.make: No such file or directory
You must run configure first
make: *** [config.make] Error 1
– ERROR: monodevelop failed to compile, press enter to continue
Any ideas?
Link | March 10th, 2011 at 6:32 pm
make[3]: Entering directory `/root/mono-src/mono/mcs’
make profile-do–net_2_0–all profile-do–net_3_5–all profile-do–net_4_0–all
make[4]: Entering directory `/root/mono-src/mono/mcs’
make PROFILE=basic all
make[5]: Entering directory `/root/mono-src/mono/mcs’
/bin/sh .//mkinstalldirs build/deps
mkdir -p — build/deps
touch build/deps/.stamp
make[6]: Entering directory `/root/mono-src/mono/mcs’
make[6]: gmcs: Command not found
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
make[6]: Leaving directory `/root/mono-src/mono/mcs’
*** The compiler ‘gmcs’ doesn’t appear to be usable.
*** You need Mono version 2.4 or better installed to build MCS
*** Read INSTALL.txt for information on how to bootstrap a Mono installation.
make[5]: *** [do-profile-check] Error 1
make[5]: Leaving directory `/root/mono-src/mono/mcs’
make[4]: *** [profile-do--basic--all] Error 2
make[4]: Leaving directory `/root/mono-src/mono/mcs’
make[3]: *** [profiles-do--all] Error 2
make[3]: Leaving directory `/root/mono-src/mono/mcs’
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/root/mono-src/mono/runtime’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/mono-src/mono’
make: *** [all] Error 2
Link | March 11th, 2011 at 10:17 am
Hello Dan, looks like exactly what’s I’m looking for!
I ran into some trouble while trying the script. Firstly I got the same error with Mono.Basic as Martin T.
Later I get this error about MonoDevelop:
– Making monodevelop
./build_mono.sh: line 372: ./autogen.sh: No such file or directory
Makefile:7: config.make: No such file or directory
You must run configure first
make: *** [config.make] Error 1
– ERROR: monodevelop failed to compile, press enter to continue
Should I try running the ./configure on Monodevelop manually, and if so, what arguments should I pass it?
Thanks :)
Mika
Link | March 11th, 2011 at 3:33 pm
@Thomas @Martin I have updated the script to target the master branch of the debugger, it should now compile.
@Kevin @Mika There was an issue with the script, apologies. I have pushed an update, git pull and MD should now compile.
@Fire Mono uses an older version of itself to compile itself. I would suggest you upgrade to 10.10 or grab Mono 2.6.7 through the backports http://www.mono-project.com/DistroPackages/Ubuntu
Link | March 11th, 2011 at 4:11 pm
Thanks, MonoDevelop compiles just fine now :)
The issue with Mono.Basic persists, but I don’t use VB so that’s fine by me.
Thank you!
Link | March 14th, 2011 at 2:17 pm
I ran into the same problem as Mika. Here is the log.
I’m using Ubuntu 11.04. I tried compiling 2.10 all
Are you planning on a fix soon?
Bill
– Making mono-basic
./mono_build.sh: line 374: ./autogen.sh: No such file or directory
make[1]: Entering directory `/home/wpbest/mono-src/mono-basic/tools’
make[2]: Entering directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
Creating ../../build/deps/net_4_0_extract-source.exe.makefrag …
make[2]: Leaving directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
make[2]: Entering directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
make all-local
make[3]: Entering directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
MONO_PATH=”../../class/lib/bootstrap:$MONO_PATH” mono –debug ../../class/lib/bootstrap/vbnc.exe /sdkpath:/usr/local/lib/mono/4.0/ -debug -r:System.Xml.dll -noconfig -define:_MYTYPE=\”Empty\” /novbruntimeref /r:../../class/lib/bootstrap/Microsoft.VisualBasic.dll -target:exe -out:extract-source.exe @extract-source.exe.sources
Symbol file /home/wpbest/mono-src/mono-basic/class/lib/bootstrap/vbnc.exe.mdb doesn’t match image /home/wpbest/mono-src/mono-basic/class/lib/bootstrap/vbnc.exe
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 2.11 – master/234d628)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.
vbnc: Command line : error VBNC2017: The library ‘System.Xml.dll’ could not be found.
There were 1 errors and 0 warnings.
Compilation took 00:00:00.2141220
make[3]: *** [extract-source.exe] Error 1
make[3]: Leaving directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
make[2]: *** [do-all] Error 2
make[2]: Leaving directory `/home/wpbest/mono-src/mono-basic/tools/extract-source’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wpbest/mono-src/mono-basic/tools’
make: *** [all-recursive] Error 1
Link | May 26th, 2011 at 4:26 pm
Bill,
I’m afraid I haven’t had time to look into it and as I don’t use VB it’s not top of the list… Pull requests welcome on github :)
Link | May 26th, 2011 at 4:30 pm
Hi,
This is to fix the mono-basic build problem:
@@ -366,6 +366,8 @@
./bootstrap-2.24 –prefix=$MONO_PREFIX
elif [ $mod == "llvm" ]; then
./configure –enable-optimized
+ elif [ $mod == "mono-basic" ]; then
+ ./configure –prefix=$MONO_PREFIX
elif [ $mod == "monodevelop" ]; then
./configure –prefix=$MONO_PREFIX
elif [[ $mod == "mono" && $GIT_MODULES == "*llvm*" ]]; then
Managed to compile everything, now I’m figuring out how to run it!
Link | July 8th, 2011 at 12:35 am