How to Install Mono on Ubuntu Linux

|

|

This tutorial demonstrates the process of installing Mono, an open-source project that supports .NET and C# code on Ubuntu Linux operating system. It provides step-by-step installation instructions, including adding the Mono repository, installing it, and confirming its installation. Instructions for installing supplementary tools, such as MonoDevelop IDE and its NUnit Plugin are also provided.

This post shows students and new users how to install the open-source project called Mono on Ubuntu 20.04 | 18.04.

Mono is an open-source project that provides a .NET-compatible and C# compiler toolset, making it possible to develop and run C# code on Linux. Installing Mono on Ubuntu Linux is a great choice for developers and users who want to work with C# code on Linux.

With Mono, you can easily build and run .NET applications on Ubuntu Linux without switching to a Windows environment.

Additionally, Ubuntu Linux is a beginner-friendly Linux distribution, making it an ideal choice for students and new users who want to learn Linux and develop C# applications.

Installing Mono on Ubuntu is pretty straightforward. Simply add its repository and install it from there. To do that, follow the steps below:

Add Mono Repository

If you always want to use the Mono version on Ubuntu, add its repository. When its repository is added, all newer versions and updates will be available to install.

To add its repository, run the commands below.

sudo apt update
sudo apt install dirmngr gnupg apt-transport-https ca-certificates

Next, run the commands below to add its repository, key, and repository file to Ubuntu.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" > /etc/apt/sources.list.d/mono-official-stable.list'

That should make the Mono repository available on Ubuntu

Install Mono

Now that the Mono repository and key are added run the commands below to install it.

sudo apt update
sudo apt install mono-complete

If you’re building a .NET project, the easiest way to do it is by using MonoDevelop IDE. To install MonoDevelop, run the commands below:

sudo apt install monodevelop

Use MonoDevelop to build your apps.

If you’re running the NUnit Unit Tests, you should install the NUnit Plugin for MonoDevelop. To do that, run the commands below:

sudo apt install monodevelop-nunit

To verify if Mono is installed, run the commands below:

mono --version

You should see similar lines below:

Output:
Mono JIT compiler version 6.6.0.161 (tarball Tue Dec 10 10:36:32 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	Interpreter:   yes
	LLVM:          yes(610)
	Suspend:       hybrid
	GC:            sgen (concurrent by default)

That should do it

Conclusion:

This post shows you how to install Mono and related development tools on Ubuntu 18.04 | 16.04. If you find any error above, please comment below:

You may also like the post below:

Like this:



3 responses to “How to Install Mono on Ubuntu Linux”

  1. Peter Patoschka Avatar
    Peter Patoschka

    hi, the title says we are gonna install it on 20.04 … for that goal this is just not correct, monodevelop will not install via apt on 20.04 if you add the correct repo, and mixing 18.04 and 20.04 repos hardly is a good idea… 🙁

    1. Antony Parakka Avatar
      Antony Parakka

      Do you get solution in 20.04?

  2. Iziren Avatar
    Iziren

    This does not work on 20.04

Leave a Reply to Antony Parakka Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.