【问题标题】:How to install mod_mono on Debian 10如何在 Debian 10 上安装 mod_mono
【发布时间】:2020-05-29 17:56:54
【问题描述】:

我想用 Apache 在 Debian 10 中运行 ASP.NET MVC 应用程序。 我已经使用 apt 从 mono Debian 10 存储库安装了最新的 mono。

尝试使用安装 mod_modo

apt install libapache2-mod-mono

抛出错误

> Reading package lists... Done Building dependency tree Reading state
> information... Done Some packages could not be installed. This may
> mean that you have requested an impossible situation or if you are
> using the unstable distribution that some required packages have not
> yet been created or been moved out of Incoming. The following
> information may help to resolve the situation:
> 
> The following packages have unmet dependencies:  libapache2-mod-mono :
> Depends: mono-apache-server (< 4.6) but 4.7.1-0xamarin2+debian10b1 is
> to be installed or
>  mono-apache-server4 (< 4.6) but 4.7.1-0xamarin2+debian10b1 is to be installed or
> mono-apache-server2 (< 4.6) but it is not installable
> E: Unable to correct problems, you have held broken
> packages.

如何在 Debian 10 上安装 mod_mono ?

/etc/apache2/mods-available 包含 mod_mono。 也许在 apache 中启用它就足够了?

/etc/sources.list 包含:

deb http://ftp.debian.org/debian buster main contrib non-free
deb http://ftp.debian.org/debian buster-updates main contrib non-free
deb http://security.debian.org buster/updates main contrib non-free

/etc/apt/sources.list.d 包含两个文件:

单官方稳定列表:

deb https://download.mono-project.com/repo/debian stable-buster main

和 pgdg.list:

deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
#deb-src http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main

更新

我尝试了来自 GAD3R 答案的命令。

apt install libapache2-mod-mono

仍然失败。错误信息有点不同:

Hit:1 http://security.debian.org buster/updates InRelease
Hit:2 http://ftp.debian.org/debian buster InRelease
Hit:3 http://ftp.debian.org/debian buster-updates InRelease
Hit:4 http://apt.postgresql.org/pub/repos/apt buster-pgdg InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libapache2-mod-mono : Depends: mono-apache-server (< 4.4) but 4.7.1-0xamarin2+debian10b1 is to be installed or
                                mono-apache-server4 (< 4.4) but 4.7.1-0xamarin2+debian10b1 is to be installed
E: Unable to correct problems, you have held broken packages.

【问题讨论】:

  • 我更新了问题并添加了这些文件内容

标签: apache mono debian apt mod-mono


【解决方案1】:

从官方 debian 存储库安装 libapache2-mod-mono

sudo rm /etc/apt/sources.list.d/mono-official-stable.list

然后运行:

sudo apt update
sudo apt purge mono.
sudo apt autoremove
sudo apt install libapache2-mod-mono

请向 monodev team on github 提交错误报告。

【讨论】:

  • 我试过这些命令。安装仍然失败。我用输出更新了问题。 apt upgrade 可能已经安装了来自 mono 存储库的最新版本。它应该从 Debian 标准存储库中删除并使用以前的 Mono 版本吗?如果是,如何?
  • 我在github.com/mono/mono/issues/18864提交了错误报告
  • @Andrus mono 未安装在您的系统上。请重新检查/etc/apt/sources.list.d/,也许mono repo仍然存在,然后运行sudo apt dist-upgrade
  • 非常感谢。有效。文件名为mono-official-stable.list(列表前的点:.list)。不幸的是,这会安装旧的单声道,它会引发错误 System.Web.Compilation.CompilationException error CS0009: Metadata file /var/www/mymvcapp/bin/Newtonsoft.Json.dll' does not contain valid metadata`。如何安装新的单声道?
  • 我应该添加单声道存储库并从中安装最新的单声道。也许在这种情况下,libapache2-mod-mono 仍然安装。
猜你喜欢
  • 2021-05-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多