How do I solve «N updates can be applied immediately» for PHP APT packages if I do not want to upgrade the major and minor numbers of the PHP version I am using?

02

2024-08-24--17-57-58

php-cgi/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-cli/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-fpm/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-gd/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-mbstring/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-mysql/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-xml/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]
php-zip/focal 2:8.3+94+ubuntu20.04.1+deb.sury.org+2 all [upgradable from: 2:7.4+75]

Step 1

apt list --upgradable

2024-08-24--17-57-58

Step 2

For every package listed:

apt-get remove php-<name>
apt-get install php7.4-<name>

E.g.

apt-get remove php-zip
apt-get install php7.4-zip

apt-get remove php-gd
apt-get install php7.4-gd

apt-get remove php-mbstring
apt-get install php7.4-mbstring

apt-get remove php-xml
apt-get install php7.4-xml

apt-get remove php-cli
apt-get install php7.4-cli

apt-get remove php-mysql
apt-get install php7.4-mysql

apt-get remove php-fpm
apt-get install php7.4-fpm

Step 3

How do I set the default version for PHP CLI installed via APT?

Step 4

apt list --upgradable

2024-08-24--19-01-36