Here's an alternative way to do it, by scanning the .deb files and
seeing if they're already installed or not.  (It's in bash, but should
be easy to convert to Python etc.):

    #!/bin/bash

    for deb in /var/cache/apt/archives/*.deb; do
        pkg=$(dpkg-deb -f $deb Package)
        if ! dpkg-query -Wf '${Status}' $pkg | grep -q ' installed'; then
            echo $pkg: not installed
            # uncomment this to remove it ...
            # rm $deb
        fi
    done

-- 
Eric Cooper             e c c @ c m u . e d u


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to