Как установить mod_mono на Debian 10

Я хочу запустить приложение ASP.NET MVC в Debian 10 с Apache. Я установил последнюю версию моно из репозитория моно Debian 10, используя apt.

Пытаюсь установить 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.

Как установить mod_mono на Debian 10?

/etc/apache2/mods-available содержит mod_mono. Может быть, достаточно включить его в апаче, чтобы он заработал?

/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.

person Andrus    schedule 13.02.2020    source источник
comment
Я обновил вопрос и добавил содержимое этих файлов   -  person Andrus    schedule 14.02.2020


Ответы (1)


Установите libapache2-mod-mono из официального репозитория Debian.

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

отправьте отчет об ошибке моно команде разработчиков на github.

person GAD3R    schedule 14.02.2020
comment
Я пробовал эти команды. Установить все равно не получается. Я обновил вопрос с выводом. apt upgrade, вероятно, установил последнюю версию из монорепозитория. Следует ли удалить его и использовать предыдущий выпуск Mono из стандартных репозиториев Debian? Если да, то как? - person Andrus; 14.02.2020
comment
Я отправил отчет об ошибке на github.com/mono/mono/issues/18864. - person Andrus; 15.02.2020
comment
@Andrus mono не установлен в вашей системе. пожалуйста, перепроверьте /etc/apt/sources.list.d/, возможно, монорепозиторий все еще существует, затем запустите sudo apt dist-upgrade. - person GAD3R; 15.02.2020
comment
Спасибо большое. Это сработало. Имя файла mono-official-stable.list (точка перед списком: .list). К сожалению, это устанавливает старый моно, который выдает ошибку System.Web.Compilation.CompilationException error CS0009: Metadata file /var/www/mymvcapp/bin/Newtonsoft.Json.dll 'не содержит действительных метаданных'. Как установить новый моно? - person Andrus; 15.02.2020
comment
Должен ли я добавить монорепозиторий обратно и установить из него последнюю версию моно. Возможно, в этом случае libapache2-mod-mono останется установленным. - person Andrus; 17.02.2020
comment
@Andrus Я включил монорепозиторий, к сожалению, проблема еще не решена. Вы можете попробовать это сами. - person GAD3R; 17.02.2020