Mono is an open implementation of Microsoft’s .NET framework, including compilers for C#.NET and VB.NET. It uses the same development libraries on Linux that exist on Windows. This means that if you code and compiled some mono code on Linux, it will compile on Windows as well. It is cool stuff.

1. Add the Mono repository to your system

The package repository hosts the packages you need, add it with the following commands. Note: the packages should work on newer Ubuntu versions too but we only test the ones listed below.
Ubuntu 18.04 (i386, amd64, armhf, arm64, ppc64el)

Ubuntu 16.04 (i386, amd64, armhf, arm64, ppc64el)

Ubuntu 14.04 (i386, amd64, armhf, arm64, ppc64el)

2. Install Mono

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 mono-dbg should be installed to get debugging symbols for framework libraries – allowing you to get line numbers in stack traces. 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. The package ca-certificates-mono should be installed to get SSL certificates for HTTPS connections. Install this package if you run into trouble making HTTPS connections. The package mono-xsp4 should be installed for running ASP.NET applications.

3. Verify Installation Success

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). Some systems are configured in a way so that the necessary package isn’t pulled in when Mono is installed, in those cases make sure the ca-certificates-mono package is installed.

Continue to Test Mono Setup