On Oct 23, 2016, at 5:48 PM, kamaraju kusumanchi <raju.mailingli...@gmail.com> 
wrote:

> How can I list all the packages installed on my system that are
> currently part of the stable distribution but not present in either
> testing or sid?


try something like this

aptitude -F ‘%p' search '~i' | while read x; do aptitude --disable-columns  
versions '^'"$x"'$'; done

This will give you a list of all installed packages with the repositories they 
are available from.

Here’s a sample

rbthomas@monk:~$ aptitude -F '%p' search '~i' | grep openocd | while read x; do 
aptitude --disable-columns  versions '^'"$x"'$'; done
Package openocd:                          
ih 0.3.1-1  100
ph 0.8.0-4 stable 500

On this machine, I have an ancient version (0.3.1-1) of openocd installed that 
is not available in the stable repo.  There is also a version (0.8.0-4) 
available from the stable repo that does not work in my environment, so I have 
the older version “held”.

This is indicated by the fact that there is no repo in the line beginning with 
“ih”.

A small awk or python script processing the output of the above commands should 
give you what you want.

Enjoy!
Rick

Reply via email to