如何在 Ubuntu 22.04 LTS 上安装 Mono

Linux命令 Edge插件网 2年前 (2023-03-05) 652次浏览 已收录 0个评论

Mono是一个开源项目,由Xamarin(现在由Microsoft拥有)开发,为Linux,macOS和其他平台提供一套与.NET框架兼容的工具。它允许开发人员在非Windows平台上构建和运行.NET应用程序。这包括对 .NET 库和框架(如 ASP.NET 和 WPF)的支持。如何在 Ubuntu 22.04 LTS 上安装 Mono

在 Ubuntu 22.04 LTS Jammy Jellyfish 上安装 Mono

第 1 步。首先,通过在终端中运行以下命令,确保所有系统软件包都是最新的。apt

<span class="pln">sudo apt update
sudo apt upgrade
sudo apt install dirmngr gnupg apt</span><span class="pun">-</span><span class="pln">transport</span><span class="pun">-</span><span class="pln">https ca</span><span class="pun">-</span><span class="pln">certificates software</span><span class="pun">-</span><span class="pln">properties</span><span class="pun">-</span><span class="pln">common</span>

第 2 步。在 Ubuntu 22.04 上安装 Mono

默认情况下,Mono 在 Ubuntu 22.04 基本存储库上不可用。现在运行以下命令,将 MonoDevelop 存储库添加到您的 Ubuntu 系统中:

<span class="pln">echo </span><span class="str">"deb https://download.mono-project.com/repo/ubuntu stable-focal main"</span> <span class="pun">|</span><span class="pln"> sudo tee </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="pln">list</span><span class="pun">.</span><span class="pln">d</span><span class="pun">/</span><span class="pln">mono</span><span class="pun">-</span><span class="pln">official</span><span class="pun">-</span><span class="pln">stable</span><span class="pun">.</span><span class="pln">list</span>

接下来,使用以下命令导入 GPG 密钥:

<span class="pln">sudo apt</span><span class="pun">-</span><span class="pln">key adv </span><span class="pun">--</span><span class="pln">keyserver hkp</span><span class="pun">:</span><span class="com">//keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF</span>

启用存储库后,现在使用以下命令安装最新版本的 Mono:

<span class="pln">sudo apt update
sudo apt install mono</span><span class="pun">-</span><span class="pln">devel</span>

要验证 Mono 是否已成功安装,请在终端窗口中输入以下命令:

<span class="pln">mono </span><span class="pun">--</span><span class="pln">version</span>

输出:

<span class="typ">Mono</span><span class="pln"> JIT compiler version </span><span class="lit">6.30</span><span class="pun">.</span><span class="lit">0.182</span> <span class="pun">(</span><span class="pln">tarball </span><span class="typ">Fri</span> <span class="typ">Dec</span> <span class="lit">16</span> <span class="lit">16</span><span class="pun">:</span><span class="lit">36</span><span class="pun">:</span><span class="lit">00</span><span class="pln"> UTC </span><span class="lit">2021</span><span class="pun">)</span>
<span class="typ">Copyright</span> <span class="pun">(</span><span class="pln">C</span><span class="pun">)</span> <span class="lit">2002</span><span class="pun">-</span><span class="lit">2014</span> <span class="typ">Novell</span><span class="pun">,</span> <span class="typ">Inc</span><span class="pun">,</span> <span class="typ">Xamarin</span> <span class="typ">Inc</span> <span class="kwd">and</span> <span class="typ">Contributors</span><span class="pun">.</span><span class="pln"> www</span><span class="pun">.</span><span class="pln">mono</span><span class="pun">-</span><span class="pln">project</span><span class="pun">.</span><span class="pln">com
	TLS</span><span class="pun">:</span><span class="pln">           __thread
	SIGSEGV</span><span class="pun">:</span><span class="pln">       altstack
	</span><span class="typ">Notifications</span><span class="pun">:</span><span class="pln"> epoll
	</span><span class="typ">Architecture</span><span class="pun">:</span><span class="pln">  x86
	</span><span class="typ">Disabled</span><span class="pun">:</span><span class="pln">      none
	M</span>

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 Mono。如需其他帮助或有用信息,我们建议您查看 Mono 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Ubuntu 22.04 LTS 上安装 Mono
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址