Install apt-show-versions package on the machine:
$ sudo apt-get install apt-show-versions -y
Get a list of packages that are upgradable:
$ apt-show-versions -u
The following shall provide you with a list of upgradable packages and their correspnding size (bytes) in ascending order:
$ for i in `/usr/bin/apt-show-versions -u | tr ' ' / | cut -f1,6 -d'/' | tr / =` ; do echo -n $i ; sudo apt-cache show $i | grep '^Size:' | cut -d: -f2 ; done | sort -k2 -n
A quick break down of the above command:
/usr/bin/apt-show-versions -u | tr ' ' / | cut -f1,6 -d'/' | tr / =
provide a list of packages with their upgradable version in packagename=version format
sudo apt-cache show $i | grep '^Size:'
fetch the size of the package
sort -k2 -n
display formatted output in ascending order
Find out security updates:
$ apt-show-versions -u | grep security
It is generally a good practise to configure security auto-updates:
$ sudo apt-get install unattended-upgrades -y
If unattended-upgrades is already installed, and you like to ensure it is configured to automatically apply security updates:
$ sudo dpkg-reconfigure unattended-upgrades