if [ ${#1} -eq 0 ]; then release="stable" else release=$1 fi tmp=`tempfile` echo -e "/\\*\\*\\*/{\nN\ns/$release/FOUND/\n}" > $tmp echo "Packages not from $release or not the current ones from $release:" for i in `dpkg --get-selections|grep -v deinstall|grep install | sed s/install//g | xargs printf "%s\n"`; do apt-cache policy $i | sed -f $tmp -|grep -q FOUND - if [ "$?" -eq 1 ]; then echo $i fi done