In Debian or one of its derivatives, how can I list all packages which I have installed from lenny-backports?

The closest I've come up with is:

aptitude search ~i~Alenny-backports

However, that lists all installed packages for which there exists a version in backports even if the currently installed version is not the one from backports. I'd like to list only the packages for which the currently installed version is from backports (or, not lenny, if that's easier).

Cheers

link|improve this question

feedback

3 Answers

up vote 3 down vote accepted

Aptitude has a ?narrow search term for just this:

aptitude search '~S ~i ~Abackports'
aptitude search '?narrow(~i, ~Abackports)'
link|improve this answer
Excellent! Aptitude saves the day! Thanks – thomasrutter Feb 4 '10 at 23:29
feedback

Ok I have found one solution. It's a bit fiddly but works well.

  1. First, comment out all backports repositories from sources.list and do an aptitude update.
  2. Second, do a search for all packages with the version containing "bpo", ie

    aptitude search ~Vbpo

Probably unlikely to result in false positives (what other version number would contain those letters?).

link|improve this answer
feedback

You can use the grep-status command (provided via the 'dctrl-tools' package):

grep-status -sPackage,Version -F Status 'installed' -a -F Version 'bp'

Example of output:

Package: libsvn-perl
Version: 1.6.4dfsg-1~bpo50+1

Package: subversion-tools
Version: 1.6.4dfsg-1~bpo50+1

Package: subversion
Version: 1.6.4dfsg-1~bpo50+1

Package: libapache2-svn
Version: 1.6.4dfsg-1~bpo50+1

Package: libsvn1
Version: 1.6.4dfsg-1~bpo50+1

Package: libdb4.7
Version: 4.7.25-7~bpo50+1

Package: trac
Version: 0.11.6-1~bpo50+1

Package: python-subversion
Version: 1.6.4dfsg-1~bpo50+1

If you need a more compact output (more suitable for further script-based processing), use simply

grep-status -nsPackage -F Status 'installed' -a -F Version 'bp'
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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