1、Add the Mono repository to your system
https://www.mono-project.com/download/stable/
sudo apt install apt-transport-https dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
sudo apt update
sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
2、Install Mono
sudo apt install mono-devel
3、Verify Installation
After the installation completed successfully, it's a good idea to run through the basic hello world examples on this page to verify Mono is working correctly.
Notes
Mono on Linux before 3.12 by default didn't trust any SSL certificates so you got errors when accessing HTTPS resources. This is not required anymore as 3.12 and later include a new tool that runs on package installation and syncs Mono's certificate store with the system certificate store (on older versions you had to import Mozilla's list of trusted certificates by running mozroots --import --sync
). Some systems are configured in a way so that the necessary package isn't pulled in when Mono is installed, in those cases make sure the ca-certificates-mono
package is installed.
4、MonoDevelop IDE
1)Add the Mono repository to your system
sudo apt install apt-transport-https dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
sudo apt update
2)、Install MonoDevelop
sudo apt-get install monodevelop
3)、Verify Installation
https://www.monodevelop.com/documentation/creating-a-simple-solution/
using System;
using MyLibrary;
class MainClass
{
public static void Main(string[] args)
{
MyClass test = new MyClass ();
Console.WriteLine("Hello {0}", test);
}
}