Category Archives: Linux

Installing Mono on CentOS 6.x

Since yum does not include a default mono package / repo, installing it has become a fairly annoying task.

Here are some steps to get Mono installed on CentOS 6.x (I am using 6.5 as of this post):

  • Create a new repo entry under /etc/yum.repos.d/ named mono.repo
  • Enter the below into the file with your favorite editor:

[home_tpokorra_mono]
name=mono and monodevelop (CentOS_CentOS-6)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/tpokorra:/mono/CentOS_CentOS-6/
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/tpokorra:/mono/CentOS_CentOS-6/repodata/repomd.xml.key
enabled=1

  • Next install all of the mono packages needed via: yum install mono*-opt
  • (Optional) In some cases you will need to register the format yourself, use the following to do so:

‘:CLR:M::MZ::/usr/local/bin/mono:’ > /proc/sys/fs/binfmt_misc/register

  • Next to always have mono in the path variable we can add it to .bashrc
    • To do this, open ~/.bashrc in your favorite editor and add the following line to it:

export PATH=/opt/mono/bin:$PATH

  • Lastly you can either restart the machine to make the path take effect, or you can execute the following to do it:

export PATH=/opt/mono/bin:$PATH

  • Done! Mono should now be working 🙂
  • You can use mono –version to output the version information.

Thanks to my friend devnull for piecing together these parts in helping me get Mono working. 🙂