Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Mono on Debian 10 Buster - DesignLinux

Jun 23 2020
designlinux 0 Comments
How to Install Mono on Debian 10

Mono platform is used to develop and run cross-platform applications. It is open-source and free implementation by the Microsoft. This tutorial explains how to install Mono on Debian 10.

Prerequisites#

Before you start installation, make sure you have logged in as root or user with sudo privileges.

Installing Mono on Debian#

Standard Debian repositories does not includes Mono package. We will install the Mono package from the official Mono’s repositories. It is a very easy to install. Perform the following steps:

1. Start by installing the necessary packages:

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

2. Import the repository’s GPG keys using below command:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

The output should look like below:

gpg: key A6A19B38D3D831EF: public key "Xamarin Public Jenkins (auto-signing) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

3. Add the Mono repository to your system sources list:

sudo sh -c 'echo "deb https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list'

4. Update the packages list and install Mono, after the apt repository is enabled:

sudo apt update
sudo apt install mono-complete

The mono-complete is a meta-package and it will install other required packages for Mono development, including the runtime, development tools, and all libraries.

5. Verify the installation printing the Mono version:

mono --version

At the time of writing this article, the latest stable version of Mono is 6.8.0 Stable (6.8.0.123).

Mono JIT compiler version 6.8.0.123 (tarball Tue Feb  4 21:20:43 UTC 2020)
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’s it. Mono installed successfully on your Debian system, you can start developing your application.

Mono Program Example#

We will create a simple Hello World program to check that everything is set up perfectly.

Open your text editor and create a file named hello.cs with the following content:

using System;

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

To build the program use the csc compiler:

csc hello.cs

It will create a executable with name hello.exe

Run the executable using the command below:

mono hello.exe

The output should show something like this:

Hello, World

Make the file executable to execute the program only by typing its name:

chmod +x hello.exe

You can now run the hello.exe file by typing:

./hello.exe

Conclusion#

You have learned successfully how to install latest stable Mono on Debian from the official Mono repositories.

If you have any question or feedback, please leave a comment below.

Related

Tags: debian, mono

Ps Command in Linux (List Processes)

Prev Post

vtop – A Linux Process and Memory Activity Monitoring Tool

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 487
  • 612,666

DesignLinux.com © All rights reserved

Go to mobile version