How To Install mono-mcs on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 514 words
Introduction
In this tutorial we learn how to install mono-mcs
on Ubuntu.
What is mono-mcs
mono-mcs is:
This is the Mono C# (C-Sharp) 2.0, 3.0, 4.0 and 5.0 compiler, a platform-independent compiler which produces CIL (Common Intermediate Language) binary executables.
This compiler targets the CLI 2.0, 4.0 or 4.5 runtime version.
The mcs compiler supports different C# versions as follows. With C# 2.0 it supports:
- generics
- iterators (yield)
- nullable value types
- partial types
- anonymous methods
- static classes
- coalesce operator: ??
With C# 3.0 it supports:
- Language Integrated Query (LINQ)
- object initializers
- collection initializers
- anonymous types
- local variable type inference
- implicitly-typed arrays
- lambda expressions
- automatic properties
- extension methods
- partial methods
With C# 4.0 it supports:
- dynamic binding (duck typing)
- named and optional arguments
- covariant and contravariant generic type parameters
With C# 5.0 (which is the default) it supports:
- asynchronous methods
- caller info attributes (as of Mono 3.0 currently not supported!)
Mono is a platform for running and developing applications based on the ECMA/ISO Standards. Mono is an open source effort led by Xamarin. Mono provides a complete CLR (Common Language Runtime) including compiler and runtime, which can produce and execute CIL (Common Intermediate Language) bytecode (aka assemblies), and a class library.
There are three methods to install mono-mcs
on Ubuntu. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install mono-mcs Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install mono-mcs
using apt-get
by running the following command:
sudo apt-get -y install mono-mcs
Install mono-mcs Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install mono-mcs
using apt
by running the following command:
sudo apt -y install mono-mcs
Install mono-mcs Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install mono-mcs
using aptitude
by running the following command:
sudo aptitude -y install mono-mcs
How To Uninstall mono-mcs on Ubuntu
To uninstall only the mono-mcs
package we can use the following command:
sudo apt-get remove mono-mcs
Uninstall mono-mcs And Its Dependencies
To uninstall mono-mcs
and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove mono-mcs
Remove mono-mcs Configurations and Data
To remove mono-mcs
configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge mono-mcs
Remove mono-mcs configuration, data, and all of its dependencies
We can use the following command to remove mono-mcs
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge mono-mcs
Dependencies
mono-mcs have the following dependencies:
- mono-runtime
- libc6
- libmono-corlib4.5-cil
- libmono-system-core4.0-cil
- libmono-system-xml4.0-cil
- libmono-system4.0-cil
- libmono-corlib4.5-cil
- libmono-microsoft-csharp4.0-cil
References
Summary
In this tutorial we learn how to install mono-mcs
package on Ubuntu using different package management tools: apt, apt-get and aptitude.