Otu esi etinye Mono Framework na Linux Mint 20

Mono bụ ikpo okwu mmepe mepere emepe nke dabere na ya .NET Okpokoro. Mono's NET mmejuputa iwu dabere na ụkpụrụ ECMA/ISO maka C # na akụrụngwa asụsụ nkịtị. Ọrụ Mono anọwo na-emepe ihe karịrị afọ iri ma na-aga n'ihu na-egosipụta n'ọtụtụ ngwa.

N'ime nkuzi a, ị ga-ama otu esi etinye ma hazie Mono na sistemụ Mint 20 Linux gị.

Prerequisites

Melite Sistemụ Ọrụ

Melite gi Mint Linux Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo apt update && sudo apt upgrade -y

Nkuzi a ga-eji ya sudo iwu na na-eche na ị nwere ọnọdụ sudo.

Iji nyochaa ọkwa sudo na akaụntụ gị:

sudo whoami

Ihe atụ na-egosi ọkwa sudo:

[joshua@linuxmint ~]$ sudo whoami
root

Ka ịtọlite ​​akaụntụ sudo dị adị ma ọ bụ ọhụrụ, gaa na nkuzi anyị na Na-agbakwụnye onye ọrụ na Sudoers na Linux Mint.

Iji mgbọrọgwụ akaụntụ, jiri iwu na-esonụ na paswọọdụ mgbọrọgwụ banye.

su

Advertisement


Wụnye ndabere achọrọ

A ga-achọrọ ndabere ndị a iji wụnye ma mee Mono nke ọma na sistemụ gị. Mepee ọdụ iwu gị wee mee iwu a ka ịwụnye wee lelee ma etinyere ha.

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

Bubata igodo GPP na ebe nchekwa

Akụkụ mbụ nke nrụnye ga-abụ ibubata igodo GPG na ebe nchekwa. Site na ndabara Linux Mint ma ọ bụ Ubuntu nwere Mono na ebe nchekwa, yabụ ịwụnye ebe nchekwa gọọmentị ga-apụta na ị gaghị enwe naanị Mono mana ụdị kachasị ọhụrụ dị n'oge niile.

Mbụ, bubata ihe igodo GPG:

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

Ọzọ, bubata ebe nchekwa Mono:

sudo sh -c 'echo "deb [arch=amd64] https://download.mono-project.com/repo/ubuntu stable-focal main" > /etc/apt/sources.list.d/mono-official-stable.list'

Mara, nke a bụ ebe nchekwa Ubuntu Focal. Agbanyeghị, ọ na-arụ ọrụ maka Linux Mint ka ọ dabere na ntọhapụ Ubuntu a.

Ugbu a iji igodo GPG na ebe nchekwa Mono agbakwunyere, melite ndepụta nchekwa gị iji gosipụta mgbanwe ndị ahụ.

sudo apt update

Advertisement


Wụnye Framework Mono

Ugbu a ị tinyela ebe nchekwa ahụ nke ọma, oge eruola ịwụnye Mono n'onwe ya. Iji mee nke a, ị ga-eji iwu apt install nke na-esonụ.

sudo apt install mono-complete -y

Na-esote, nyochaa nrụnye na ụdị arụnyere.

mono --version

Ihe atụ mmepụta:

Otu esi etinye Mono Framework na Linux Mint 20

Nhọrọ ọzọ iji nyochaa ntinye nke Mono Framework bụ iji iwu amụma apt-cache.

sudo apt-cache policy mono-complete

Ihe atụ mmepụta:

Otu esi etinye Mono Framework na Linux Mint 20

Mepụta ngwa ule

Iji lelee na Mono na-arụ ọrụ, ị ga-emepụta obere mmemme nwere nkebi ahịrịokwu ama ama (Ndewo Ụwa). Ị ga-eme nke a site na imepe ederede ederede ọkacha mmasị gị iji mezuo nke a. Maka ntuziaka, anyị ga-eji nchịkọta ederede nano.

Mepee ọnụ ọnụ gị, wee mepụta faịlụ .cs dị ka n'okpuru.

sudo nano helloworld.cs

Ọzọ, tinye koodu mmemme:

using System;

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

Ozugbo emere, CTRL + O ịzọpụta, yabụ  CTRL + X ịpụ apụ.

Ugbu a ị nwere ike itinye koodu ahụ. Iji mee nke a, mebie iwu a:

mono-csc helloworld.cs

Iwu mkpokọ ga-arụ ọrụ nke enwere ike ịkpọ aha helloworld.exe, Ozugbo emechara ị nwere ike ịme nke a ka ịhụ koodu na-arụ ọrụ site na ịme iwu a:

mono helloworld.exe

Ị ga-enweta nsonaazụ kpochapụ:

Otu esi etinye Mono Framework na Linux Mint 20

Ụzọ ọzọ iji mezuo mmemme ahụ bụ ime ka faịlụ ahụ rụọ ọrụ n'onwe ya. Enwere ike ime nke a site n'ịgbanwe ikike faịlụ dị ka n'okpuru:

chmod +x helloworld.exe

Ugbu a ị nwere ike ịme faịlụ ahụ n'onwe ya site na ịme iwu ndị a:

./helloworld.exe

Ihe Nlereanya:

Otu esi etinye Mono Framework na Linux Mint 20

Ị kwesịrị ịnata mmepụta ndewo ụwa ọzọ. Ọ bụrụ na ị nwere nsogbu n'oge ọ bụla, ị nwere ike ịtọ ntọala $PATH agbanwe.

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

Advertisement


Otu esi emelite Mono

Imelite Mono dị mfe ma jiri iwu dị mfe mee ya na ọdụ gị. Tinye ihe ndị a:

sudo apt update

Ọ bụrụ na mmelite dị, jiri iwu nkwalite apt ọkọlọtọ ọkọlọtọ.

sudo apt upgrade

Otu esi ewepu (wepụ) Mono

Ọ bụrụ n'ọdịniihu ịchọghị Mono na sistemụ arụmọrụ Mint Linux gị, mee iwu a:

sudo apt autoremove mono-complete --purge -y

Ị ga-enweta nsonaazụ na-esote na ewepụrụ Mono nke ọma na sistemụ gị.


Advertisement


Okwu na mmechi

N'ime nkuzi a, ị mụtala ịwụnye usoro Mono wee mee obere mmemme mbụ gị na sistemụ Mint Linux gị.

N'ozuzu, Mono bụ nhọrọ dị egwu maka ndị mmepe nke na-agafe agafe na-enweghị akwụ ụgwọ maka ikikere ngwanrọ ma ọ bụ mkpọchi ndị na-ere ahịa yana ịbụ ebe mepere emepe. Naanị ihe dị njọ na Mono bụ na mgbe ụfọdụ API ya enweghị ike ịdị ka ọ dị ọhụrụ ozugbo mgbe ewepụtara ụdị ọhụrụ nke NET framework.

Maka ozi ndị ọzọ gbasara iji Mono, gaa na onye ọrụ gọọmentị akwụkwọ

Ahapụ a Comment