I had a few servers that needed upgrading from PHP7.2 to 7.3, so I wrote this little single-line command to help simply things.
It uses apt list
to get the PHP modules that are currently installed with 7.2, and passes them through to apt install
for 7.3.
sudo apt install $(apt list --installed | grep php7.2- | cut -d'/' -f1 | sed -e 's/7.2/7.3/g')
This can easily be modified for any PHP version later.