2

I want to run ASP.NET MVC application in Debian 10 with Apache. I have installed latest mono from mono Debian 10 repository using apt.

Trying to install mod_modo using

apt install libapache2-mod-mono

throws error

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

How to install mod_mono on Debian 10 ?

/etc/apache2/mods-available contans mod_mono. Maybe it is sufficient to enable it in apache to get it work ?

/etc/sources.list contains:

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 contains two files:

mono-official-stable-list:

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

and 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

Update

I tried commands from GAD3R answer.

apt install libapache2-mod-mono

still fails. Error message is a bit different:

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.
Andrus
  • 26,339
  • 60
  • 204
  • 378

1 Answers1

2

Install libapache2-mod-mono from the official debian repository.

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

Then run :

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

please file a bug report to mono dev team on github.

GAD3R
  • 4,317
  • 1
  • 23
  • 34
  • I tried those commands. Install still fails. I updated question with output. `apt upgrade` has probably installed latest release from mono repository. Should it removed and previous Mono release from Debian standard repositories used?. If yes, how ? – Andrus Feb 14 '20 at 20:52
  • 1
    I filed bug report in https://github.com/mono/mono/issues/18864 – Andrus Feb 14 '20 at 21:09
  • @Andrus mono isn't installed on your system. please re-check `/etc/apt/sources.list.d/` maybe mono repo is still exist , then run `sudo apt dist-upgrade`. – GAD3R Feb 14 '20 at 21:31
  • Thank you very much. It worked. File name is `mono-official-stable.list` (dot before list: .list). Unfortunately this installs old mono which throws error `System.Web.Compilation.CompilationException error CS0009: Metadata file `/var/www/mymvcapp/bin/Newtonsoft.Json.dll' does not contain valid metadata`. How to install new mono? – Andrus Feb 14 '20 at 22:01
  • Should I add mono repository back and install latest mono from it. Maybe in this case `libapache2-mod-mono` remains installed. – Andrus Feb 17 '20 at 07:03
  • @Andrus I have enabled the mono repository , unfortunately the issue isn't solved yet. You can try it by yourself. – GAD3R Feb 17 '20 at 07:46