How do I install the Mono 2.6.7 runtime on CentOS 5.5 using YUM?
I know how to build Mono from the source. However, according to the page Getting Started With Mono Tools it is possible to install the binaries directly. I'd prefer to install the binaries to avoid having to install all the development pre-requisites on a server with little disk space.
Am I supposed to add a new repository description to YUM? I tried doing that, but I must have done it wrong, because "yum list mono-core" still says the old version (1.2.4-2.el5.centos).
And, why are the .rpm's called "mono-addon-" on the release server? It's a bit confusing. It sounds like the .rpm's are an add-on to Mono. I guess they mean they are an "add-on" to the server(?).
I figured it out.
cd /etc/yum.repos.d vi mono.repo
[Mono] name=Mono Stack (RHEL_5) type=rpm-md baseurl=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/ gpgcheck=1 gpgkey=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/repodata/repomd.xml.key enabled=1
yum clean all
yum install monotools-addon-server
The installed binaries will end up in "/opt/novell/mono/bin".
You should issue the following command to set up your shell environment so that it finds Mono, mcs and the other Mono tools
source /opt/novell/mono/bin/mono-addon-environment.sh
mono --version Mono JIT compiler version 2.6.7 (tarball Mon Jul 19 18:28:58 UTC 2010) Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC: Included Boehm (with typed GC and Parallel Mark) SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none
If you want the Mono environment to be permanent you can issue the following command.
cp /opt/novell/mono/bin/mono-addon-environment.sh /etc/profile.d
Happy Mono'ing!!!
In addition to octonion's post, if, like me, you want to use Apache mod_mono, you need to ensure you install the correct version of mod_mono by running the following, and it will get the right one:
yum install mod_mono-addon
Don't just issue yum install mod_mono
. It may install mod_mono 1.2 version from the CentOS extras repository and not what you're actually after.
As a reference, I was getting the following error in /var/log/httpd/error_log
when running the incorrect mod_mono version:
Root directory: /
mod_mono and xsp have different versions. Expected '9', got 6 System.InvalidOperationException: mod_mono and xsp have different versions. Expected '9', got 6
It is a silly, but easy mistake to make if you new to this like me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With