Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, imagine we have two packages: banana.deb and banana-common.deb. Inside banana.deb, we have some file, that is quite big and changes rarely. Both packages are currently at version 0.0.1, and banana depends on banana-common.

Now, because we want to reduce banana.deb size, we want to move that file into banana-common package. If I just do that (updating both versions to 0.0.2 and try to install with dpkg -i, I see the following:

$ sudo dpkg -i banana-common.deb banana.deb
dpkg: error processing banana-common.deb (--install):
 trying to overwrite '/usr/local/banana/', which is also in package banana 0.0.1

How can I fix it without removing the package first?

share|improve this question
up vote 1 down vote accepted

In debian/control add something like

Conflicts: banana (< 0.0.2)

to the package section for banana-common.

share|improve this answer
And that would force dpkg to install them in parallel? – Rogach Feb 20 '13 at 5:04
Man pages say something like "The package maintenance software will not allow conflicting packages to be installed at the same time". Wouldn't it just fail the installation? – Rogach Feb 20 '13 at 5:08
It makes banana-common 0.0.2 to conflict with banana 0.0.1 but not banana 0.0.2. That makes the package manager first upgrades banana before it upgrades banana-common – Florian Diesch Feb 20 '13 at 5:15
But new banana will be dependent on 0.0.2 version of banana-common, so it can't be upgraded, either. – Rogach Feb 20 '13 at 5:16
sudo dpkg -i banana-common.deb banana.deb or apt-get upgrade will upgrade both in right order. – Florian Diesch Feb 20 '13 at 5:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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