We want to perform only critical security updates on our Ubuntu Systems. We found two effective ways for upgrading security systems
One is using the apt-get upgrade and then use grep to filter security packages
root@vagrant-ubuntu-trusty-64:/etc/apt# sudo apt-get upgrade -s| grep -i security | wc -l
0
root@vagrant-ubuntu-trusty-64:/etc/apt#
The other is using unattended upgrades
root@vagrant-ubuntu-trusty-64:/home/vagrant# sudo unattended-upgrade --dry-run -d 2> /dev/null | grep 'Checking' | awk '{ print $2 }' | wc -l
32
root@vagrant-ubuntu-trusty-64:/home/vagrant#
As you can see the both are showing different result for packages, what is the correct way to update the security packages ?