Install Mono and Monodevelop on CentOS 5.x/6.x
On these systems, I typically install Mono from source. It is a bit more work but you do not have to rely on dated or broken packages that may or may not be maintained. Also, it makes it easy to upgrade to the latest versions of Mono.
The instructions below were tested on CentOS 6.4.
Head over to /usr/src
as root
su
cd /usr/src
Ensure GCC and friends are installed (to build the Mono source code)
yum install gcc gcc-c++ libtool bison autoconf automake
Grab and unpack the Mono source code
wget http://download.mono-project.com/sources/mono/mono-3.0.7.tar.bz2
tar -xvjf mono-3.0.7.tar.bz2
Build and install Mono
cd mono-3.0.7
./configure --prefix=/usr
make && make install
Verify that you have a working Mono installation with mono --version
and mcs --version
Build the GDI+ compatibility layer (required for System.Drawing)
yum install glib2-devel libX11-devel pixman-devel fontconfig-devel freetype-devel libexif-devel libjpeg-devel libtiff-devel libpng-devel giflib-devel
cd /usr/src
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
tar -xvjf libgdiplus-2.10.9.tar.bz2
cd libgdiplus-2.10.9
./configure --prefix=/usr
make && make install
That is it for Mono but building MonoDevelop is another story...
Build Gtk-Sharp
yum install gtk2-devel libglade2-devel
cd /usr/src
wget http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.8.tar.bz2
tar -xvjf gtk-sharp-2.12.8.tar.bz2
cd gtk-sharp-2.12.8
./configure --prefix=/usr
make && make install
Unfortunately, I do not think there is a proper source tarball of gnome-sharp that is new enough for what we need. So, we will get it from the Git repository.
yum install pango-devel atk-devel libgnome-devel libgnomecanvas-devel libgnomeui-devel git svn libtool
cd /usr/src
git clone git://github.com/mono/gnome-sharp
cd gnome-sharp
./bootstrap-2.24 --prefix=/usr
make && make install
Same for Mono Addins...
cd /usr/src
git clone git://github.com/mono/mono-addins
cd mono-addins
./autogen.sh --prefix=/usr
make && make install
Finally, we can build MonoDevelop itself.
cd /usr/src
wget http://download.mono-project.com/sources/monodevelop/monodevelop-3.1.1.tar.bz2
tar -xvjf monodevelop-3.1.1.tar.bz2
cd monodevelop-3.1.1
PKG_CONFIG_PATH=/usr/lib/pkgconfig
export PKG_CONFIG_PATH
./configure --prefix=/usr --select
make && make install
You should now see MonoDevelop in the Programming menu under Applications!
Now that we are doing all this fun Git stuff, it is easy enough to upgrade to the latest (pre-release) version of Mono any time we want...
First time checking out of Git:
cd /usr/src
git clone git://github.com/mono/mono
cd mono
./autogen.sh --prefix=/usr
make && make install
To just upgrade to the latest version (after the first time building from Git)
cd /usr/src/mono
git pull
./autogen.sh --prefix=/usr
make && make install
If you do not want the bleeding edge, you can use Git to check-out more stable branches of Mono instead. I will leave that as an exercise for Wikipedia.
How can I install MONO on Centos 5, without compiling from source
The answer is to use the pre-built packages from https://lbs.solidcharity.com/package/tpokorra/mono/mono-opt
Thanks to Timotheus Pokorra for providing them.
Note: You will need to add the provided env.sh
to /etc/profile.d
(or to your individual profile) to set the necessary environment variables.
To use libgdiplus, you will also need to add /usr/local/lib
to your /etc/ld.so.conf
(or, better, add a file containing that text to /etc/ld.so.conf.d
).
Installing latest mono on Centos 6
Well, this is what I came up with and it worked for me:
based on this article:
$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
$cd /usr/local/src
$wget http://download.mono-project.com/sources/mono/mono-3.0.1.tar.bz2
$tar jxf mono-3.0.1.tar.bz2
$cd mono-3.0.1
$./configure --prefix=/opt/mono
$make && make install
Then I downloaded the MonoDevelop
IDE and compiled my program using Mono framework.
Then in Centos I called my program:
/opt/mono/bin/mono /root/MyFolder/MyProgramDir/myProgram.exe "$@"
Xamarin development on Centos 6
Due to the complexity of Linux distribution and various dependencies, Xamarin only supports Windows and OS X as supported development platforms. Thus, you either use a Windows machine, or a Mac.
Related Topics
How to Find the Maximum Stack Size
How Clear and Invalidate Arm V7 Processor Cache from User Mode on Linux 2.6.35
How to Specify More Spaces for the Delimiter Using Cut
Using 'Date' Command to Get Previous, Current and Next Month
Specifying Udp Receive Buffer Size at Runtime in Linux
Openshift: "Failed to Execute Control Start" on Node Application
Http Post and Get Using Curl in Linux
Limitations of Intel Assembly Syntax Compared to At&T
Bind Ctrl+Tab and Ctrl+Shift+Tab in Tmux
Get Ceiling Integer from Number in Linux (Bash)
How to Trim White Space from a Variable in Awk
Centos 64 Bit Bad Elf Interpreter
How to Get the Percentage of Memory Free with a Linux Command
Library Path When Dynamically Loaded
Awk - How to Delete First Column with Field Separator