I am trying to install something new on a server with apt-get and am getting this error:

The following packages have unmet dependencies:
 cassandra : Depends: python-support (>= 0.90.0) but it is not installable
             Recommends: ntp but it is not going to be installed or time-daemon
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Everything I have found on the net so far advises upgrading/uninstalling Cassandra. I definitely can't do that! How can I get this error to go away without messing with Cassandra? I don't mind if I can't upgrade it afterwords using the package manager.

Is there a way to remove the package but leave all its files in place?

  • What happens if you try apt-get install python-support ? – wurtel Mar 7 at 10:58
  • 1
    It might be a better solution to add python-support to /var/lib/dpkg/status then at least all the cassandra files will still be protected against modification and may receive config updates etc. – user188737 Mar 7 at 11:09
  • Did you install cassandra from the wrong Ubuntu version? That's the usual cause of the problem. – Michael Hampton Mar 7 at 13:25
  • I tried installing python-support got Package python-support is not available. So I edited /var/lib/dpkg/status and removed the dependency on python-support from cassandra. That worked and I was able to install new stuff! Tx guys. @user188737 you should answer my question so I can tick it. – David Tinker Mar 7 at 13:41
  • Ok. I tried changing the conflict settings in /var/lib/dpkg/status and that didn't seem to work, deleting or adding a package did. It seems that dependency changes here work. I will check that out on my Ubuntu also and formulate an answer. Of course, if cassandra is updated, then the missing dependency problem will reappear. – user188737 Mar 7 at 14:16

You can manipulate the dpkg package management system by hand editing its database of packages in one of the possible installed states: /var/lib/dpkg/status. It is quite human friendly readable. Each package in its own block with empty lines in between. Each block can specify Depends, Conflicts, Breaks, Provides, Replaces type of lines, which are parsed by dpkg to get a view of the tree of packages and install possibilities or problems.

Of course you should be beware of editing this file when apt or dpkg programs are running. Stopping the unattended-upgrades service could also be important. And also realize that your edits are lost when a package that you edited is up/downgraded replaced by alternatives or from another repository.

In this case it is possible to remove the python-support package from the Depends: line of the cassandra package and then dpkg has no missing dependency anymore.

You can also put a Hold marker on the cassandra package to stop it and its status entry from being overwritten accidentally or unattended: apt-mark hold cassandra

Other possibilities would be removing the cassandra package from the status database. But that would make it vulnerable for missing upgrades to other packages that make it non-functional. Its files would be left alone, and there may be trigger scripts that are triggered by other package configurations.

Or you could add a fake python-support package. Of course that would be dangerous if some other program is installed later on that really depends on it.

Some more apt tricks: https://unix.stackexchange.com/a/161940

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.