大网数据广告活动
服务器运维问答

Using mozjpeg in place of jpeg-turbo including satisfying dependencies

· 52CE 我爱测

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…

问题原文

原帖链接 · fvm · CC BY-SA 3.0

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.

已采纳解答

原帖链接 · HBruijn · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。