How do I list all packages from unstable / experimental?

I'm running a Debian testing system with some packages installed from unstable or experimental, using apt pinning.

How can I list all packages that come from unstable or experimental? I'd like to use apt, but I have aptitude and synaptic installed as well.


Solution 1:

One option is to install apt-show-versions. For example, to find packages installed from unstable:

$ apt-show-versions | grep unstable

Also, the following script might be of interest: A script to check how mixed your system is.

Solution 2:

Using aptitude you can run the following command:

$ aptitude versions '~VCURRENT (~Aunstable|~Aexperimental) !~Atesting' --group-by=none

This will list all packages whose currently installed version (~VCURRENT) comes from the unstable or experimental archives (~A) and are not present in the testing archive (!~A). The --group-by=none option serves to produce a more terse output.