Otu esi etinye Mono Framework na Debian 11 Bullseye

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 na-esote, ị ga-ama ka esi etinye na hazie Mono na sistemụ arụmọrụ Debian 11 Bullseye gị.

Prerequisites

  • OS akwadoro: Nnenna 11 Bullseye
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ihe ùgwù or ohere mgbọrọgwụ (su Command).
  • Ngwungwu achọrọ: hụ wụnye ndabere achọrọ

Na-emelite Sistemụ Ọrụ

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

sudo apt update && sudo apt upgrade

Mgbọrọgwụ ma ọ bụ Sudo Access

Site na ndabara, mgbe ị mepụtara akaụntụ gị na mmalite na Debian ma e jiri ya tụnyere nkesa ndị ọzọ, ọ naghị enweta ọkwa sudoers ozugbo. Ị ga-enwerịrị ike ịnweta ya mgbọrọgwụ paswọọdụ iji iwu su ma ọ bụ gaa na nkuzi nkuzi anyị Otu esi etinye onye ọrụ na Sudoers na Debian.

Wụnye ndabere achọrọ

A ga-achọrọ ndabere ndị a iji wụnye ma mee Mono nke ọma na sistemụ Debian 11 Bullseye 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

Advertisement


Bubata igodo GPP na ebe nchekwa

Akụkụ mbụ nke nrụnye ga-abụ ibubata igodo GPG na ebe nchekwa ebe Debian 11 anaghị eso Mono na ebe nchekwa ya.

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 https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list'

Mara, nke a bụ ebe nchekwa Buster. Agbanyeghị, ọ na-arụ ọrụ maka Bullseye.

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

sudo apt update

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:

Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-3.2 Tue Jun 29 21:01:01 UTC 2021)

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:

mono-complete:
  Installed: 6.8.0.105+dfsg-3.2
  Candidate: 6.8.0.105+dfsg-3.2
  Version table:
 *** 6.8.0.105+dfsg-3.2 500
        500 http://ftp.au.debian.org/debian bullseye/main amd64 Packages
        100 /var/lib/dpkg/status

Advertisement


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ụ:

Hello World!

Ụ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

Ị 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"

Okwu na mmechi

N'ime ntuziaka ahụ, ị ​​mụtala ịwụnye usoro Mono wee mee obere mmemme mbụ gị na sistemụ Debian 11 Bullseye 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ọ

Idenye aha
Gwa nke
0 Comments
Inline nzaghachi
Lee echiche niile
0
Ga-ahụ n'anya gị echiche, biko okwu.x