CentOS 5.x/6.x doesn't have a recent version of Mono in its repositories. So a version must be fetched separately.
EditCompiling from source
Compiling Mono from source has the advantage of letting you use newer versions than are pre-supplied by Novell.
You can find a list of Mono versions available to download at
http://download.mono-project.com/sources/mono/ - In this example we will be installing version 2.10.8.
EditInstalling Dependencies
All of the required dependencies are available via the Yum package manager.
First: you'll have to add the epel rpm:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
After the epel repo has been added, the following can be executed:
yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
EditDownloading and Compiling¶
In some cases, you may want to use a prefix of /opt/mono - this will
require you to either add this directory to your PATH environment
variable, or explicitly specify the full path to Mono when you want to
run it.
Then run the following as root:
cd /usr/local/src
wget http://download.mono-project.com/sources/mono/mono-2.10.8.tar.gz
tar zxvf mono-2.10.8.tar.gz
cd mono-2.10.8
./configure --prefix=/usr/local
make && make install
Instead of
./configure --prefix=/usr
you can use
./configure --prefix=/opt/mono
(as discussed above).
If you get an "Out of memory" error while running make on memory-limited
systems, try running the following to allow higher virtual memory
usage:
ulimit -v unlimited