install mono redhat

August 12, 2011

Create a new repo config file

cd /etc/yum.repos.d
vi mono.repo

Add the following lines to the file

[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

Update the yum cache to be on the safe side

yum clean all

Install the Mono server stack

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

Verify the version

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