After reading info page of aptitude and a dozen of attempts, I finally got this :
aptitude search '?narrow(?installed,?not(?archive(testing)) ?archive(unstable))'
or (equivalent) :
aptitude search '~S ~i (!~Atesting ~Aunstable)'
It will search packages installed from unstable archives of any repository. You have to filter out packages from your default archive (testing in above example).
If you want to filter packages installed from www.debian-multimedia.org/unstable :
aptitude search '~S ~i (!~Atesting ~Aunstable ?origin("Unofficial Multimedia Packages"))
Edit: “Archive”, “origin” etc. are deducted from the Release
file of the repository. Unfortunately not all tools can look at all those lines and they use different syntax for them. You can find those files as /var/lib/apt/lists/*Release
. Or just type apt-cache policy
to get an overview. apt-cache changed its output format: later versions use apt_preferences style.
Suite:
or Archive:
(old name!)
- aptitude search:
?archive(___)
or ~A___
- aptitude format:
%t
- apt_preferences:
release a=___
- Ubuntu examples:
natty-backports
, trusty-security
, stable
Origin:
- aptitude search:
?origin(___)
or ~O___
- aptitude format: n/a
- apt_preferences:
release o=___
- Ubuntu examples:
Canonical
, Google, Inc.
, LP-PPA-dockbar-main
, Ubuntu
- all other lines
I prefer
?any-version()
, because~narrow(pat1, pat2)
is the same as?any-version(pat1 pat2)
and it supports?any-version(pat1 pat2 pat3)
without looking stupid. – Robert Siemer – 2014-03-15T18:04:37.877