2

I'm trying to use mozjpeg as a drop-in replacement library for jpeg-turbo. I'm perfectly able to fetch the sources and compile them as needed and even create a deb-file from it which I can use to install the package (e.g. apt-get install ./mozjpeg_3.2_amd64.deb).

To be clear, note that these two packages are supposed to provide the exact same interface and hence be functionally equivalent. Accordingly, a dependency on jpeg-turbo should be satisfied by mozjpeg.

Ok, going on, when I then continue to install dependant packages (e.g. ghostscript development headers, libgs-dev), I run into errors as these have declared a dependency on libjpeg62-turbo-dev:

dpkg: error processing archive /tmp/apt-dpkg-install-HuzNRO/0-libjpeg62-turbo-dev_1%3a1.5.1-2_amd64.deb (--unpack):
trying to overwrite '/usr/include/jerror.h', which is also in package mozjpeg 3.2-20170219

Now, that a conflict arises at this point is of course logical. Is there a way to prevent this? Can I tell the dependency system that mozjpeg satisfies the dependency on jpeg-turbo so that any packages which depend on jpeg-turbo will install using the replacement?

Thanks in advance.

fvm
  • 23
  • 4

1 Answers1

1

dependencies are encoded by the package maintainers in the packages themselves as a dependency on a specific package name and/or version. There is, as far as I know, no method that you as an end-user can manipulate such dependencies from for instance an apt-get config file .

It is possible create dependency relations on specific functionality, rather than depending on a specific package name, via a virtual-package when multiple packages are offering identical functionality, but typically that requires coordination with the other package maintainers.

For your own environment you could try that without any such coordination though:

There are a number of warnings in the manual, but when you build the package for mozjpeg you can use the Provides: jpeg-turbo option to make it a virtual package that, once it is installed, would satisfy dependency requirements for packages that need jpeg-turbo.

HBruijn
  • 72,524
  • 21
  • 127
  • 192