Mono is a free, open-source, and platform-independent implementation of Microsoft’s Dot Net framework. The Mono project was built to compile and test applications of C, C++, and other object-oriented languages. In most cases, developers use the dot net parts through the Mono tool for building cross-platform programs.
The Mono tool is available for Linux systems. Using the dot net core on Linux is quite heavy, while the Mono is simple, easy to understand GUI, and lightweight. It supports most of Dot net native libraries and functions.
Of course, the place of Microsoft’s dot net core and Mono software is not the same for all sectors; they both have different roles to play in development. In some cases, Mono is overwhelmed over the dot net core. However, if you’ve been using the Dot net core and the framework, using Mono would be an easy task for you.
Mono on Linux
Mono is built under the European Computer Manufacturers Association (ECMA) standards which ensures the quality of the software. If you’re using an older version of Mono on your Linux machine, Mono allows you to update the older versions. It is written in C, C#, XML programming languages, and it has the MIT license.
The Mono software is consists of a core component, GNOME development unit, and Microsoft’s part. In Linux, the Mono tool functions in a whole combination of the execution unit, library unit, assembly unit, and metadata unit. In this post, we will see how to install the Mono software on Linux systems.
1. Install Mono On Debian/Ubuntu Linux
Installing the Mono software on a Ubuntu/Debian system is easy, and all the command lines are official. First, you need to run the following apt command on your terminal shell with root access to install the GnuPG (GNU Privacy Guard) on your system.
- Install GNU Privacy Guard on Ubuntu
sudo apt install gnupg ca-certificates
- Install GNU Privacy Guard on Debian
sudo apt install apt-transport-https dirmngr gnupg ca-certificates
Now, run the apt commands given below to add the keyserver cryptographic key on your machine. Then run the echo command to download the Mono Project for Debian/Ubuntu system.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
Finally, run the following commands given below to update the system repository and install the Mono software on your Ubuntu/Debian Linux system. Please do not skip running the apt-update command because it will fetch the Mono project data that we’ve just downloaded via the Echo command.
sudo apt update sudo apt install mono-devel
After installing the Mono runtime tool on Ubuntu/Debian, you can also install the Mono IDE (MonoDevelop) package on your system by running the following command on the shell with root access.
sudo apt-get install monodevelop
2. Install Mono on Red Hat Linux Enterprise
Installing the Mono tool on RHEL/Fedora Linux requires the same procedure of installing it on Ubuntu only with different commands. The command lines that I am about to describe are executable on Red Hat and Fedora systems. First, you may start with adding the RPM keys by importing the keyserver cryptographic key into your Red Hat Linux system.
rpmkeys --import "https://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
Fedora workstation users might need to run the following rpm command to add the key to the system.
rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
I must note, usually in GNOME-based distributions, by default, the system restricts from going into the superuser mode. In that case, you run the following
sudo command with a
i flag for executing the superuser commands.
Then run the cURL command with superuser access to download the Mono tool on your system.
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
Lastly, run the following commands given below to update the system repository and install the Mono software on your Red Hat Linux system. Please execute the DNF command-set on Fedora and the RPM command-set on Red Hat Enterprise.
Update repository and install Mono on Red Hat systems.
sudo yum update sudo yum install mono-devel
Run the following commands to update the repository and install Mono on Fedora System.
sudo dnf update sudo dnf install mono-devel
When the Mono installation finishes, you can check the Mono version to know if the installation ends up correctly or not.
$ mono --version
To install the MonoDevelop (IDE) for executing the dot net functions, run the following DNF command on the terminal.
sudo dnf install monodevelop
3. Install Mono on Arch System
If you’re an Arch-based Linux user, there are no official command lines available for installing the Mono tool on the Arch system. But, depending on your system, you can find Mono packages on the Pamac GUI software installer tool. Here, I’m using a Manjaro KDE distribution to demonstrate the Mono installing process on Arch.
First, open your Pamac GUI tool and search for Mono. In the search result, you would see a bunch of Mono tools on the store. Some of those are user-manual, and some of them are library tools. Please find out the main Mono tools among the tools.
Once you recognize the main Mono tool, open it and check if it has the official Mono project URL and GPL license on the description part. You can also check the dependencies, files, and details of the package before installing it.
To install the Mono package, just click on the Install button and proceed with the root password. It will take a while to gather the required library functions and package files.
When the Pamac GUI tool displays the transaction summary, please proceed with the Apply button to install the Mono tool on your Arch-based Linux system.
Remove Mono From Linux
Removing the Mono project from a Linux system is easy. If you’re using a Debian/Ubuntu system, please run the following command on the terminal shell to remove Mono from your system.
sudo apt-get purge mono-runtime sudo apt remove --purge --auto-remove mono-runtime
The DNF-based Fedora users might need to run the following command given below to remove Mono from the Linux system.
$ sudo dnf remove mono
And, if you’re using an Arch-based system where you installed the Mono tool through the GUI Pamac tool, you already know where to find the Mono tool and how to remove it from your system.
Just open the GUI Pamac tool and search for the Mono tool under the ‘Installed‘ tab, and when the Mono tool appears on search, click to expand the page. Then simply click on the ‘Remove‘ button to remove Mono from the machine.
Installing the Mono tool on a Linux system is pretty nifty and straightforward. The Mono project itself supplies all the required commands and keys. If you have a Raspberry Pi board or a Docker container, you can also install and use the Mono tool on the Pi boards and docker. In the entire post, I’ve described the methods of installing the Mono software on a Linux system.
Please share this post with your friends and the Linux community if you find it helpful and handy. You can also write down your opinions regarding this post in the comment section.