16

I have two packages that each create /usr/bin/ffprobe. One of them is ffmpeg from the Deb Multimedia repository, while the other is ffmbc 0.7-rc5 built from source. The hand-rolled one is business-critical, and we used to just install it from source wherever it was necessary. I can only assume it would clobber the ffmpeg file, and there were never any ill effects.

In theory, it should be acceptable for our ffmbc package to overwrite the file from the ffmpeg package. The drawback there is that an update to ffmpeg will overwrite the ffmbc binary. Is there any easy way to reconcile this?

Joel E Salas
  • 5,562
  • 15
  • 25

3 Answers3

13

On Debian based systems there is the DPKG (below apt) can have diversions setup using the command dpkg-divert

dpkg-divert is the utility used to set up and update the list of diversions.

File diversions are a way of forcing dpkg(1) not to install a file into its location, but to a diverted location. ... System administrators can also use it to override some package's configuration file, or whenever some files (which aren't marked as 'conffiles') need to be preserved by dpkg, when installing a newer version of a package which contains those files.

So for your case you might use a command like this to setup a diversions. (I haven't tested, check the man page and verify that this seems right.)

dpkg-divert --local --divert /usr/bin/ffprobe.ffmpeg --rename /usr/bin/ffprobe
Zoredache
  • 128,755
  • 40
  • 271
  • 413
8

Another solution I found was to change how I built the ffmbc package. Generally it's possible to pass an alternate prefix for the purpose of changing the final paths of the installed files:

./configure --prefix=/usr/local

For Debian packages, this goes in the ${package}/debian/rules file as follows:

override_dh_auto_configure:
    ./configure --enable-gpl --prefix=/usr/local

By putting the ffmbc files in /usr/local, I can keep the ffmpeg files in /usr and allow each package to update independently.

Joel E Salas
  • 5,562
  • 15
  • 25
  • 3
    Packages should not install anything to `/usr/local` -- it is a policy violation. The whole point of `/usr/local` it to keep files under package management and manually installed files apart. See the following FHS related discussion: https://unix.stackexchange.com/questions/30/where-should-i-put-software-i-compile-myself – Onlyjob Aug 27 '14 at 00:42
-1

Packages providing same file(s) should conflict with each other -- it they don't it is a bug (please consider reporting such cases). If you build software from sources and install using make install (or similar) make sure it goes to /usr/local to avoid conflicts with package management.

Please note that deb-multimedia.org is deprecated unofficial repository notorious for causing conflicts with official packages.

If software you need is not packaged for Debian then you can submit packaging request RFP but please check for existing requests first.

Onlyjob
  • 328
  • 1
  • 7