Ubuntu 16.04/Recent Mono

Install a more recent Mono (optional)

(To deepen see also: Install Mono on Linux)

To install the latest Mono from the Xamarin repository, first a new repository must be added:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

Then update the local installation table:

apt-get update
apt-get upgrade

Testing, what would be installed. Therefor call the installation, but interrupt it for now.

apt-get install mono-devel

After the output of planned changes refuse the installation with "no". Search now in the output for the following location (the packages here are mentioned as examples and differ dependent on the version):

The following packages were automatically installed and are no longer required:
libmono-corlib2.0-cil libmono-entityframework-sqlserver6.0-cil libmono-system2.0-cil
Use 'apt-get autoremove' to remove them.

So remove the appropriate packages as recommended (package names again as examples):

apt-get autoremove libmono-corlib2.0-cil libmono-entityframework-sqlserver6.0-cil libmono-system2.0-cil

Now we repeat the same two steps for "mono-complete" again:

apt-get install mono-complete

Uninstalling the packages necessary for old Mono, the new Mono will be automatically installed as a "dependency".

Also consider more recent packages external from the Mono project, so again:

apt-get upgrade

Control: "apt-get install mono-complete" now wants to install nothing more. "mono -V" displays the installed version.