How to install and configure Mono on CentOS 8

Mono is a platform for cross-platform application development and operation based on ECMA / ISO standards. It is a free and open source application for the Microsoft .NET framework.

This tutorial explains how to install Mono on CentOS 8.


The instructions assume that you are signed in as a root or superuser sudo.

Install Mono on CentOS 8

The easiest and recommended way to install Mono on debian 10 is to install it directly from the Mono repository. This is a relatively straightforward process and will only take a few minutes.

  1. Import the GPG key from the repository with the following command:
    sudo rpm --import ''
  2. Add Mono repository to your system by running the command below:
    dnf config-manager --add-repo

    The output will look like this:

    Adding repo from:
  3. Once the repository is enabled, install Mono using:
    sudo dnf install mono-complete

    mono-complete Are all the metadata packages you need for mono development, mono-complete will install the Mono runtime, development tools and all mono libraries.

  4. Verify the installation by typing the following command that will print the Mono version:
    mono --version

    At the time of writing this article, the latest stable version of Mono is 6.8.0 fixed (

    Mono JIT compiler version (tarball Tue Feb  4 19:28:42 UTC 2020)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors.
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          yes(610)
        Suspend:       hybrid
        GC:            sgen (concurrent by default)

At this point, you have successfully installed Mono on CentOS 8, and you can start using it.

See also  How To Install PHP 8 on Arch Linux | Manjaro

Getting started with Mono with Hello World

To verify that everything is set up correctly we will create a program that prints the classic “hello world” message.

Open a text editor nano And create a file called hello.cs with the following contents:

nano hello.cs
using System;

public class HelloWorld
    public static void Main(string[] args)
        Console.WriteLine ("Hello World!");

use csc To build the program:

csc hello.cs

The above command will create an executable file named hello.exe.

Run the executable file using the command below:

mono hello.exe

The output will look like this:

Hello, World

If you want to run the program by typing its name only, you must set a flag so that it can be executed with the chmod command:

chmod +x hello.exe

You can now play the file hello.exe By typing:



The latest Mono firmware packages are available for installation from the official Mono package repositories.


Source link

Originally posted 2020-11-17 12:43:20.

About wahyuway

Check Also

How to install and configure Anaconda on CentOS 7

How to install and configure Anaconda on CentOS 7

Anaconda is the most popular machine learning and data science tool used in large scale …

Leave a Reply