Switching from debian-multimedia.org packages to official Debian versions

I've been using a mix of d.o. (the main Debian APT repository -- debian.org) and d-m.o (previously debian-multimedia.org, now deb-multimedia.org) on my laptop running Wheezy (testing), but for various reasons wanted to switch back to d.o. for any packages available through it, but keep d-m.o for packages that aren't (libdvdcss2, gtkpod-aac, etc).

Firstly, the main and immediate reason I'm doing this is that some recent update to mencoder version as provided by d-m.o, broke it for one of my applications (setting frame rate of a 60p video to 24p to achieve lossless slow motion playback) -- no errors would be returned, but mencoder would get "stuck" at 99%. Also, some of the packages hosted by d-m.o are duplicates of d.o. packages, which could create additional problems for me in the future. Finally, due to an unfortunate situation with ffmpeg (with some developers leaving the project, forking it as libav), in the d.o. repo, ffmpeg is now marked as deprecated and serving as a transitional package to libav-tools, while in the d-m.o repo it isn't (or wasn't at the time I looked). As a user, I just want a functional system. Running a testing flavor of Debian is adventurous enough for me. 🙂

Ok, with that bit of background out of the way, here are the steps I used to revert packages my system already had from d-m.o to the older versions provided by d.o.

Because I had both d.o. and d-m.o in my sources.list, APT chose the packages from d-m.o because they had more recent versions:

$ cat /etc/apt/sources.list
#deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 CD Binary-1 20111121-05:07]/ wheezy main contrib non-free

deb http://ftp.ca.debian.org/debian wheezy main contrib non-free
deb-src http://ftp.ca.debian.org/debian wheezy main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

#deb ftp://ftp.debian-multimedia.org wheezy main non-free
deb ftp://ftp.deb-multimedia.org wheezy main non-free

To downgrade, I needed to give the d.o. repo a higher priority. According to APT preferences manual (man apt_preferences), giving the d.o. repo preference higher than 1000 and d-m.o repo a preference between 0 and 100, should do the trick:

   How APT Interprets Priorities

       Priorities (P) assigned in the APT preferences file must be positive or negative integers. They are interpreted as follows (roughly speaking):

       P > 1000
           causes a version to be installed even if this constitutes a d.o.wngrade of the package
     
       ...

       0 < P <=100
           causes a version to be installed only if there is no installed version of the package
$ cat /etc/apt/preferences
Package: *
Pin: origin *.debian.org
Pin-Priority: 1001 

Package: *
Pin: origin *.deb-multimedia.org
Pin-Priority: 1
$ sudo apt-get clean
$ sudo apt-get update
$ sudo apt-get upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be DOWNGRADED:
  gstreamer0.10-ffmpeg lame libgtkpod1 libmlt++3 libmlt-data libmlt4 libquicktime2 libvlc5 libvlccore5 libxine2 libxine2-bin libxine2-doc libxine2-ffmpeg libxine2-misc-plugins libxine2-plugins libxine2-x libxvidcore4 melt mencoder mplayer python-mlt3 transcode transcode-doc vlc-data
0 upgraded, 0 newly installed, 24 downgraded, 0 to remove and 1 not upgraded.
Need to get 0 B/21.3 MB of archives.
After this operation, 27.6 MB disk space will be freed.
Do you want to continue [Y/n]? y

It then proceeded to replace d-m.o packages with d.o. ones. Once done, mencoder started working for me again. Yay.

If my understanding is correct, with the above combination of /etc/apt/sources.list and /etc/apt/preferences, packages from d-m.o will continue to be available, and installed packages automatically upgraded, but only when the same package isn't available from d.o. If that doesn't work out for any reason, I could always remove d-m.o altogether (as Debian MultimediaCodecs wiki page suggests) and either install the binary packages from d-m.o manually, or try the Ubuntu versions, or install from source.

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).