aptnotifier.sh
#!/bin/bash
#
# Cron Script - run from /etc/crontab or /etc/cron.daily
#
# Runs "apt-get update" and prints the output of a simulated
# dist-upgrade if new packages are found.
 
apt-get update 2>&1 > /dev/null
if [[ "`apt-get --simulate dist-upgrade 2>&1 | grep Inst | wc -l`" != "0" ]]; then
        apt-get --simulate dist-upgrade
fi