Install Mono on Linux
Regardless of your distribution, you will need the Mono Project GPG signing key, which package managers require.
Debian, Ubuntu, and derivatives
Add the Mono Project GPG signing key (if you don’t use sudo, be sure to switch to root):
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Next, add the package repository (if you don’t use sudo, be sure to switch to root):
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
Update your package cache (i.e. run
apt-get update), and run a package upgrade to upgrade existing packages to the latest available. Then install Mono as described in the Usage section.
Note: While the APT package is built against Debian Wheezy, it is compatible with a number of Debian derivatives (including Ubuntu) which means you can use the same repository across all these distributions.
mod_mono (Ubuntu 13.10 and later, Debian 8.0 and later)
To enable mod_mono installation on Ubuntu 13.10 and later, and Debian 8.0 and later (and their derivatives), you will need to add a second repository to your system, in addition to the generic Debian/Ubuntu repository above (if you don’t use sudo, be sure to switch to root):
echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
Older Ubuntu releases (Ubuntu 12.10 and 12.04)
To enable installation on older Ubuntu releases such as Ubuntu 12.04 and Ubuntu 12.10 (and their derivatives), you will need to add a second repository to your system, in addition to the generic Debian/Ubuntu repository (if you don’t use sudo, be sure to switch to root):
echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
CentOS, Fedora, and derivatives
Add the Mono Project GPG signing key in a root shell with:
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
Next, add the package repository in a root shell:
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
Update your package cache and run a package upgrade to upgrade existing packages to the latest available.
Users of CentOS or RHEL (or similar distributions) may need to add the EPEL repository to their system to satisfy all dependencies
openSUSE and SLES
You can install using SUSE One-Click files (see below for descriptions):
The package mono-devel should be installed to compile code.
The package mono-complete should be installed to install everything - this should cover most cases of “assembly not found” errors.
The package referenceassemblies-pcl should be installed for PCL compilation support - this will resolve most cases of “Framework not installed: .NETPortable” errors during software compilation.
After the installation completed successfully, it’s a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Mono on Linux before 3.12 by default didn’t trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono’s certificate store with the system certificate store (on older versions you had to import Mozilla’s list of trusted certificates by running
mozroots --import --sync).
Accessing older releases
If for some reason you want to pin an older version of Mono rather than updating to the latest, you can modify the Debian repository to “wheezy/snapshots/X.XX.X” instead of “wheezy”. For example, “wheezy/snapshots/3.10.0” will lock you to that version.
These snapshots will cease receiving updates as soon as the next major Mono version gets uploaded - for example, as soon as Mono 3.12 gets uploaded, 3.10 will never receive updates.
On RPM distributions, force the package version in your package manager - all older versions are published in the YUM metadata and should be available.