2

After I sudo apt-get install mono-devel , when I try to purge mono-devel on Ubuntu Linux 16.04, I get the following error message:

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:
 mono-devel : Depends: mono-runtime (>= 2.10.1) but it is not installable
              Depends: libmono-cecil-private-cil (>= 2.6.3) but it is not going to be installed
              Depends: libmono-codecontracts4.0-cil (>= 1.0) but it is not going to be installed
              Depends: libmono-compilerservices-symbolwriter4.0-cil (>= 1.0) but it is not going to be installed
              Depends: libmono-corlib2.0-cil (>= 2.6.3) but it is not going to be installed
              Depends: libmono-corlib4.0-cil (>= 2.10.1) but it is not going to be installed
              Depends: libmono-peapi2.0-cil (>= 2.4.2) but it is not going to be installed

Why does this error occur and how can I fix it?

Also, is it necessary to install mono-devel for a production system? I understand that mono-devel contains various development tools and pulls in the default development stack for Mono .

We may be using mono-devel for C#/ASP.NET webforms compilation and development.

[EDIT June 13 2016 7:46AM] This morning I ran sudo apt-get -f install followed by sudo apt-get remove mono-devel. Here is the resulting error message: vanhuys@udel-ThinkStation-S10:~$ sudo apt-get remove mono-devel 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.2) but it is not going to be installed or mono-apache-server4 (>= 4.2) but it is not going to be installed Depends: mono-apache-server (< 4.4) but it is not going to be installed or mono-apache-server4 (< 4.4) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

  • Please always run sudo apt-get update before a package install ... and before removing a package. I.e. : Currently Ubuntu 16.04 receives updates every day .... will be more consistent in a few months. - – Knud Larsen Jun 11 '16 at 9:55
  • @Knud Larsen, Thank you for your very helpful comment. I can understand having to run sudo apt-get update before package install. However, why do I have to run sudo apt-get update before package removal? What command do I run to find out the contents of the package mono-devel? Please have a nice weekend. – Frank Jun 11 '16 at 10:53
  • It looks like you ran apt-get install mono-devel (and apt is trying to upgrade it to the latest version). I don't see how you could get this error message if you were removing mono-devel. If this is really the output from apt-get purge mono-devel, what does apt-get -f install do? – Gilles Jun 11 '16 at 11:59
  • @Gilles, You are a genius. -f, --fix-broken Fix; attempt to correct a system with broken dependencies in place.This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention. May I ask how I may have corrupted my Ubuntu Linux 16.04 system's dependency structure? Thank you. – Frank Jun 11 '16 at 13:06
  • It's hard to tell what happened, probably an apt operation that got interrupted midway. The logs in /var/log/apt might provide a clue. – Gilles Jun 11 '16 at 13:11
4

If you were getting this error on an install operation then a likely cause would be that your local database of available packages doesn't match what's available on the server, so APT is requesting package versions that don't exist anymore. The fix in that case is to run apt-get update to update the local availability database. However I don't see how this could happen on a remove or purge operation.

It's possible that the APT database was in a transitional state with unresolved dependencies. APT can't cope with unresolved dependencies so the first thing it needs to do, even on a removal operation, is to fix those dependencies. Try running apt-get -f install to get into a consistent state without changing what APT considers to be the desired state, before you make changes to the desired state such as requesting the installation or removal of a package.

  • Thank you for your great answer. Do I try apt-get -f install or apt-get -f install mono-devel? I may not be able to do this until Monday morning 7:00 AM EDT June 13 2016. How could I reach you at that time? – Frank Jun 11 '16 at 13:32
  • @Frank Just apt-get -f install: the idea is to first repair, then modify. – Gilles Jun 11 '16 at 14:45
  • Thank you for your comment. I will try it Monday morning 7:30A.M EDT June 13 2016 and tell you the results. – Frank Jun 11 '16 at 18:19
  • I just posted my results and error message at the end of my original question. I found nothing interesting in /var/log/apt, May I ask how to fix the error message? Thank you. – Frank Jun 13 '16 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.