4

I develop (or maintain) a package, I've gotten several bug reports along the lines of:

dpkg: error processing /var/cache/apt/archives/libjline-java_1.0-1_all.deb (--unpack):
 trying to overwrite '/usr/share/java/jline.jar', which is also in package scala 2.9.2-400
Errors were encountered while processing:
 /var/cache/apt/archives/libjline-java_1.0-1_all.deb

but I haven't found a way to prevent/find them before someone hits them. How can I prevent these file conflicts/collisions before this even happens?

0

1 Answer 1

8

To prevent this with Ubuntu packages you can use apt-file and just run all your package against the file database that can be found using apt-file:

apt-file search -D your_deb_file.deb

This will require that you have apt-file installed and updated. Then add the package name (and possibly version) to the Break or Conflict fields, in the respective package entries in the control file. That should be enough.

Now, some would want to replace Ubuntu files with their own, like offering a newer version of the applications, in such cases the best is to use the same debian/ files as the Ubuntu packages. This will create your package with the same shape as upstream and file collisions can be adverted.

Note: if the user likes to mix repositories from different maintainers, nothing you can do.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .