在 Ubuntu/Debian 中安装 Mono 3.x

Installing Mono 3.x in Ubuntu/Debian(在 Ubuntu/Debian 中安装 Mono 3.x)
本文介绍了在 Ubuntu/Debian 中安装 Mono 3.x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近读到 Mono 3.0 发布时带有 C# 5 编译器并支持 MVC 4:

I've recently read that Mono 3.0 has been released with a C# 5 compiler and support for MVC 4 here:

http://www.mono-project.com/Release_Notes_Mono_3.0

http://tirania.org/blog/archive/2012/Oct-22.html

在我的一生中,我不知道从哪里获得它作为 Linux 甚至 Windows 的软件包.

For the life of me I cannot work out where to get it from as a package for Linux or even Windows.

此页面似乎表明它仍处于测试阶段:

This page seems to suggest it's still in Beta:

http://www.go-mono.com/mono-downloads/download.html

我尝试在 Ubuntu 12.10 上执行 apt-get install mono-complete,但安装的是 2.10.8.1.

I've tried doing a apt-get install mono-complete on Ubuntu 12.10 but it's installed 2.10.8.1.

我尝试在我的 Windows 机器上安装 MonoDevelop 3,但它只向我展示了 MVC 3 项目,并且似乎正在使用 .NET 框架.

I've tried installing MonoDevelop 3 on my Windows machine and that's only presented me with MVC 3 projects and appears to be using the .NET framework.

我对 Mono 完全陌生,我已经在 Google 上搜索了所有可能的东西来尝试看看它是如何工作的,但我感到很困惑.如果可能的话,我很想在 Linux 上运行它并尝试一些东西.

I'm entirely new to Mono and I've Googled everything possible to try and see how this works but am baffled. I'd love to get this working on Linux if possible and try some stuff out.

有人可以对此有所了解吗?还是我需要从源头开始构建它?

Can someone shed some light on this or do I need to be looking at building this from source?

推荐答案

Mono 3.x 对于 Ubuntu 12.10 来说太前沿了.以这种方式从 directhex 的 PPA 中获取预览包(这将安装 3.2.1):

Mono 3.x is too bleeding edge for Ubuntu 12.10. Grab preview packages from directhex's PPA this way (this will install 3.2.1):

sudo add-apt-repository ppa:directhex/monoxide

(如果你使用的是 Ubuntu saucy 13.10,在添加存储库后你需要编辑文件 /etc/apt/sources.list.d/directhex-monoxide-saucy.list 并替换单词saucyraring)

(If you use Ubuntu saucy 13.10, after adding the repository you need to edit the file /etc/apt/sources.list.d/directhex-monoxide-saucy.list and replace the word saucy with raring)

然后,在那之后:

sudo apt-get update && sudo apt-get dist-upgrade

如果您之前安装了 monodevelop,这也会让您获得 MonoDevelop 4.x.

This will also get you MonoDevelop 4.x if you had monodevelop installed before.

注意:directhex 不是随便创建 PPA 的人,他是所有 Mono 和基于 Mono 的软件包的 Debian/Ubuntu 维护团队的一员.因此,使用这是升级基础架构的最正式方式.

NOTE: directhex is not some random guy that created a PPA, he's part of the Debian/Ubuntu maintainer team of all the Mono and Mono-based packages. So using this is the most official way to upgrade your infrastructure.

对于 debian 用户:mono 3.0.6 和 MonoDevelop 4.0.x 已在 debian 测试中可用.所以我建议得到这个:

And for the debian users out there: mono 3.0.6 and MonoDevelop 4.0.x is already available in debian testing. So what I recommend to get this is:

  1. 安装 debian testing(当前名为 debian jessie).
  2. 通过执行 sudo apt-get purge mono-runtime 卸载单声道(执行此操作后,抵制执行 sudo apt-get autoremove 的诱惑,否则您将破坏您的系统,我在这里报告了一个错误).
  3. 修改/etc/apt/sources.list,找到提到main源的第一行,将jessie这个词重命名为sid.
  4. 执行 sudo apt-get update.
  5. 通过 sudo apt-get install monodevelop 安装 monodevelop,它也会将 mono 作为依赖项.
  6. 还原您在第 3 步中所做的操作.
  7. 再次执行第 4 步.
  1. Install debian testing (currently named debian jessie).
  2. Uninstall mono by doing sudo apt-get purge mono-runtime (after doing this, resist the temptation to do an sudo apt-get autoremove or you will break your system, something which I reported as a bug here).
  3. Modify /etc/apt/sources.list, locate the first line that mentions the main source, and rename the word jessie to sid.
  4. Do sudo apt-get update.
  5. Install monodevelop via sudo apt-get install monodevelop, which will pull mono as a dependency too.
  6. Revert what you did in step 3.
  7. Do step 4 again.

这样你就有了一个或多或少现代的发行版(与 debian stable 不同),加上非常现代的 mono 包(Mono 的前沿版本通常非常稳定).

This way you have a more or less modern distro (as opposed to debian stable), plus very very modern mono packages (the bleeding edge versions for Mono are normally pretty stable).

F# 用户:Mono 3.0.6 存在一个错误,导致该语言无法在此版本中运行,请改用 Mono 3.2.x.

F# users: Mono 3.0.6 has a bug that prevents this language to work in this version, please use Mono 3.2.x instead.

这篇关于在 Ubuntu/Debian 中安装 Mono 3.x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

quot;dotnet restorequot; fails with quot;SSL peer certificate or SSH remote key was not OKquot;(“dotnet 恢复因“SSL 对等证书或 SSH 远程密钥不正常而失败)
Accessing network path using C# from Ubuntu(在Ubuntu中使用C#访问网络路径)
How to setup virtual Gpio loopback(如何设置虚拟GPIO环回)
HttpWebRequest NameResolutionFailure exception in .NET (with Mono on Ubuntu)(.NET 中的 HttpWebRequest NameResolutionFailure 异常(在 Ubuntu 上使用 Mono))
Method #39;RouteCollection.get_AppendTrailingSlash#39; not found when using Razor Url helpers in ASP.NET MVC 5 Mono(在 ASP.NET MVC 5 Mono 中使用 Razor Url 帮助程序时找不到方法“RouteCollection.get_AppendTrailingSlash)
Compiling C# projects with VSCode on Ubuntu(在 Ubuntu 上使用 VSCode 编译 C# 项目)