List installed packages in Ubuntu
Easy.
apt list --installed | grep php
This will show you all PHP packages installed on your server or workstation. If an update exists for a specific package, it will show in this list:
php7.1-cli/now 7.1.20-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,upgradable to: 7.1.28-1+ubuntu16.04.1+deb.sury.org+3]
Here is an update for the package php-cli from version 7.1.20 to version 7.1.28.