# Calculates the total installed size of all packages, in M
# Depends on the package debian-goodies (specifically the program dpigs)

#!/bin/sh
export TOTALSUM=0
for i in $( dpigs -n `dpkg -l | grep ^ii | wc -l` | awk '{print $1}' ); do
	TOTALSUM="${i} + ${TOTALSUM}"
	echo "scale=2;($TOTALSUM)/1024"|bc
done
clear
echo "scale=2;($TOTALSUM)/1024"|bc
