Pretending a Package is Installed by Creating an Empty Package with Checkinstall (for Debian-based Distributions)

After installing ffmpeg from svn with checkinstall, I had the problem that the also installed library libavcodec51 is not compatible with the one delivered with Ubuntu. But I could not simply uninstall it so that the manually installed version was used because that caused problems with libxine1-ffmpeg, which stopped kaffeine, amarok and other software from running properly.

Unfortunately, checkinstall's --provides option did not work as expected. So I had to find a way to have them use the manually installed version I compiled from svn and hiding that fact that my package manager. I had to let the package management system know the package was already installed.

So I ended up creating an artificial package that only has the same name and a similar package version, but no actual contents. Create an empty directory, place the following Makefile into it and execute the following checkinstall command. You may need to adjust the parameters for different packages, refer to the output of apt-cache policy somepackage for an appropriate version number)
Makefile:

install:
install -d /usr/local/bin

checkinstall commands:
checkinstall --nodoc --install=no --pkgname=libavcodec51 --pkgversion=3:0.svn$(date +%Y%m%d)-12ubuntu5
checkinstall --nodoc --install=no --pkgname=libavutil49 --pkgversion=3:0.svn$(date +%Y%m%d)-12ubuntu5
checkinstall --install=no --nodoc --pkgname=libavformat52 --pkgversion=3:0.svn$(date +%Y%m%d)-12ubuntu5
sudo dpkg --install ./*.deb
sudo ldconfig


This elegantly fixed the error "ffplay: symbol lookup error: /usr/local/lib/libavcodec.so.52: undefined symbol: av_gcd" and "ffmpeg: error while loading shared libraries: libavformat.so.52: cannot open shared object file: No such file or directory" for me.

10 comments:

  1. Hi! Last time recompiled ffmpeg from svn I had some trouble with this too ( from http://ubuntuforums.org/showthread.php?t=786095 ) I'll give this a try later thx!

    ReplyDelete
  2. sudo apt-get install equivs-build
    equivs-build libavcodec51

    ReplyDelete
  3. Hi BJ,

    thanks! Good to know.
    you mean: sudo apt-get install equivs ;)

    ReplyDelete
  4. Thank you for posting this. I've been having the same problem for about two weeks after compiling ffmpeg for mediatomb 0.12

    Thought something like this may have fixed the dependancy issue but I didn't know how to construct an empty make file.

    Cheers!

    ReplyDelete
  5. I am trying to use the fix, but installation fails: http://pastie.org/993606

    How do you think, what am I doing wrong?

    Thank you!

    ReplyDelete
  6. Is it correct that I've maned the project folder libavcodec51? I've places a Makefile inside with those content given:
    install:
    install -d /usr/local/bin

    But it throws those error posted before.

    Thanks!

    ReplyDelete
  7. did you check with and without space at the beginning and end of the makefile?

    you could try the equivs package, see above in the comments.

    ReplyDelete
  8. Hi,

    how do I "Create an empty directory, place the following Makefile into it and execute the following checkinstall command".

    It's baby steps for me and I'll be so glad for a helping hand.
    ):

    ReplyDelete
  9. 1. mkdir empty
    2. cd empty
    nano Makefile (enter text, ctrl-x, Y (for yes).
    3. execute command, replace package name and version with whatever you need.

    ReplyDelete

I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.