Ubuntu – Replacing Multiple Debian Packages from Compiled Source

dpkgkubuntupackage-managementUbuntu

I've had to download and install a version of a library from its source code repository. The problem is is that other packages from the Kubuntu package manager require this library to be installed. Right now I'm working with ffmpeg, but I've had to do it before (e.g. OpenCV) and I'm looking into the best way of doing this for the future…

So what I'm trying to do is create a debian package that I can install with dpkg using checkinstall. I've since decompressed the deb file to modify it trying to get it working correctly

The problem is, ffmpeg is split into multiple packages in the package manager and I don't want to have to write the 5/6 packages to replace each and every one if I don't have to. I have made sure it is properly compiled with everything that is required for all these packages.

I've been trying to use the "Requires" and "Replaces" but it just doesn't seem to work correctly. When I try to install VLC afterwards, it asks to install all the ones from the package manager. I've also made sure the version number is later than the ones in the package manager.

VLC Pre-Requisites

Here's what's written in my deb control file. As far as I can see, this is all recognised in the muon package manager.

Package: ffmpeg
Priority: extra
Section: checkinstall
Installed-Size: 172216
Maintainer: root@skund
Architecture: amd64
Version: 8:1.2.1-git-2
Provides: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2
Replaces: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2
Description: Package created with checkinstall 1.6.2

And here it is installed in the package manager:

ffmpeg package manager
ffmpeg package manager 2

Does anyone have any ideas on getting this working?

Best Answer

Well, for one thing, Provides: does not work with dependencies that specify a version. From the Debian Policy Manual, "Virtual packages - Provides":

If a relationship field has a version number attached, only real packages will be considered [...]. In other words, if a version number is specified, this is a request to ignore all Provides for that package name and consider only real packages.

Dependencies on libraries are almost always versioned. So that's just not going to work.

Instead, you could:

  • Download the Debian package (apt-get source PACKAGE) and update it for the latest ffmpeg (and, indeed, you could even send patches required to the Debian bug tracker). Of course you'll need to update the sonames of the libraries (I bet the ABI changed), and probably rebuild a lot of stuff that depends on ffmpeg. Some of that may require source changes if the API changed.
  • Or, the easy way: install it to /usr/local. You can build a .deb of that, and give it a different package name (e.g., local-ffmpeg). You can then install it alongside the Debian-provided ffmpeg, and not worry about all the above. You could also use stow to install it in /usr/local.
Related Question