How to install two packages that write the same file

Solution 1:

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

Solution 2:

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.