0

I'm running kubuntu 14.04 and don't plan on upgrading until at least these summer holidays. The libav packages provided are somewhat outdated (two major versions behind) and produce unsatisfying output for some of my use-case. For this reason, I tried building and installing from source, which proved to solve the issues I had. I wish to keep it that way (I'm fairly experienced with git and shouldn't have problems updating my snapshot and keeping the deps up to date), and now I want to uninstall the several libav packages I have in order to do a bit of cleanup and prevent weird conflicts.

When I try to do that, apt-get wants to remove a whole bunch of other (meta)-packages, because they rely on libav (vlc, dolphin, kubuntu-desktop (!), etc).

How can I rebind all those applications to the new libav executables I built (I guess it should be fairly direct if install them globally with sudo make install), and how can I then safely uninstall the out of date packages without breaking my setup?

Edit: following @MoonSweep advice, I tried building an equivs package, but I have issues getting it done: here's the ouput if I try to remove the libav packages with no equivs package to fullfill the deps:

$sudo apt-get remove libavcodec-* libavformat* libavutil*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libavcodec-dev' for regex 'libavcodec-*'
[...more regex gibberish...]
The following packages were automatically installed and are no longer required:
libechonest2.1 libftgl2 libglew1.10 libprojectm2 libprotobuf8 libqxt-core0
libqxt-gui0 projectm-data
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
baloo clementine dolphin gstreamer1.0-libav gstreamer1.0-plugins-bad
kubuntu-desktop libavcodec-dev libavcodec-extra libavcodec-extra-54
libavformat-dev libavformat54 libavutil-dev libavutil52 libbaloowidgets4
libchromaprint-dev libchromaprint0 libk3b6-extracodecs libkfilemetadata4
libopencv-contrib2.4 libopencv-highgui2.4 libopencv-legacy2.4
libopencv-objdetect2.4 libswscale-dev libswscale2
nepomuk-core-ffmpegextractor phonon-backend-vlc vlc vlc-nox
vlc-plugin-notify vlc-plugin-samba
0 upgraded, 0 newly installed, 30 to remove and 0 not upgraded.
After this operation, 64.2 MB disk space will be freed.
Do you want to continue? [Y/n]

Here's the equivs package I installed

### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2

Package: libav-source
# Version: <enter version here; defaults to 1.0>
# Maintainer: Your Name <yourname@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
Provides: libavcodec-extra,libavcodec-extra-54,libavformat,libavformat54,libavutil52,libswscale2,libswscale2,gstreamer1.0-libav,libavcodec-dev,libavformat-dev,libavutil-dev,libswscale-dev
# Replaces: <comma-separated list of packages>
# Architecture: all
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Files: <pair of space-separated paths; First is file to include, second is destination>
#  <more pairs, if there's more than one file to include. Notice the starting space>
Description: <short description; defaults to some wise words>
 long description and info
 .
 second paragraph

But it doesn't seem to provide enough, as the previous remove command has the exact same result. What am I doing wrong?

  • Did you build libav as static or shared? If shared & you went to new major version of libav then no package that uses those shared libs will use the new ones no matter what you do. They will have to be rebuilt using newer libav & in some cases patched to build correctly. If you built as static then you only produced some binaries that should work ok for the few things that use avconv, ect. avconv is provided by libav-tools package. – doug Mar 27 '15 at 11:18
  • libavtools isn't in that list because I didn't have issues uninstalling it. I built libav as shared (hoping for some better HVEC support in vlc as a bonus); but if I understand you well, unless I'm ready to start to tinker around with vlc, etc, I'm better off leaving the old libs in place and living with the eventual redundancy? – nathdwek Mar 28 '15 at 12:21
  • They aren't redundant, libavcodec54 can coexist with libavcodec56. Again using vlc as example once built off of libav9 it will only use libavcodec54. You'd have to rebuild vlc using libav11 to get vlc to use libavcodec56. To see run this - ldd /usr/lib/vlc/plugins/codec/libavcodec_plugin.so |grep libavcodec What's listed on the left is what it has to find to use/work. So in a nut shell any source that uses libav libs would have to be rebuilt. Right now the only thing using your libav11 shared libs are binaries you built like avconv, avplay, ect. – doug Mar 28 '15 at 13:26
  • If you want to see example of libav11 shared & package built along with sources rebuilt to use it then you can take a look at my JL2 ppa. So that vlc is linked to & will use libavcodec56, ect. Here I have libavcodec54, libavcodec56 & libavcodec-ffmpeg56 all installed, working fine & not redundant. launchpad.net/~mc3man/+archive/ubuntu/testing6 (- if ever inclined to try ppa read page carefully & totally remove your current libav11 install... – doug Mar 28 '15 at 13:41
0

You don't need to "rebind" those applications; if your libraries are properly installed (even in /usr/local), the applications should be able to find them.

What you need is to build and install a fake package that pretends to provide those libraries, in order to satisfy the dependencies from the package manager's perspective. Take a look at the equivspackage.

  • This seems to be the way to go, but I can't seem to do it the proper way. See edited question. – nathdwek Mar 27 '15 at 10:06
  • I think you should also add Conflicts and/or Breaks fields in your config file, so that the packages are automatically removed when you install your fake package (see the Debian Policy). This is for convenience; It probably won't be sufficient to solve your problem, that's the tricky part: you have to hunt down all missing dependencies. As a side note, I'm not sure that gstreamer1.0-libav is provided by your locally installed libraries. – MoonSweep Mar 27 '15 at 14:29
  • A 'fake' package in this case is an utter waste of time. For example a vlc built off of libav9 needs libavcodec54, it cannot use libavcodec56 that libav11 provides – doug Mar 27 '15 at 14:50
  • Yes, but that's not what the OP asked. He asked how to unisnstall the libav packages without uninstalling the packages depending on them. – MoonSweep Mar 27 '15 at 15:18
  • He did so thinking that his new libav build will replace the current installed libs, it will not. Remove libavcodec54 or libavcodec-extra-54 & vlc will fail to start as will any other package that requires the shared libav libs. – doug Mar 27 '15 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.