I want to list all packages of the form
$ dpkg -l libav\*
but in addition to this output, I would like the origin/source (I'm not sure of the preferred term) of each package. If the package doesn't correspond to any source, it should say unknown or similar. Off the top of my head, the most promising approach would be to use dctrl-tools, but I'm not sure how to go about it. For background, I was trying to debug a library mismatch with ffmpeg. See Debian bug report - ffmpeg: backport of 4:0.6.1-5 from unstable produces WARNING: library configuration mismatch. The bug report is no longer an issue, but I'm still interested in this question.
Just to be clear on the format, this should look something like
ii libavahi-client-dev 0.6.27-2+squeeze1 Development files for the Avahi client library squeeze
ii libavcodec-dev 4:0.6.1-5 Development files for libavcodec unstable
If the same package is available in multiple categories, ie. in both squeeze and testing, then the lowest / oldest category available should be used. In this case, squeeze.
apt-cache policy <package>gives relevant info; I'm too lazy to produce an actual script to link it todpkg's output. – 9000 Mar 28 '11 at 15:46apt-cache policyreports it, as pointed out by 9000 above. If the package is not in any archive, it should be reported as unknown. See my updated question above. – Faheem Mitha Mar 28 '11 at 17:46apt-cache policyis showing where the package can currently be obtained from, not where it was originally obtained from when installed. – Arrowmaster Mar 28 '11 at 18:20apt-cache policyis reading the information in apt's database, which is (usually) updated viaapt-get updateoraptitude update(not sure if these actually update the same stuff). So it is as current as the most recent update. – Faheem Mitha Mar 28 '11 at 18:23