#!/bin/sh

IGNOREPATTERN="(ftp.earth.li sarge|security.debian.org|ftp.nerim.net testing)"

for package in `dpkg --get-selections|egrep -v '(deinstall|purge)' |cut -f1`; do
    apt-cache policy $package | grep -A 1 "^ \*\*\*" | \
    egrep "$IGNOREPATTERN" > /dev/null || echo $package
done

