Running the "apt-get install php" command on Ubuntu 20.04LTS automatically installed the php8.3* package

SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.4
Webmin version 2.111 (after update)
Virtualmin version 7.10.0 (after update)
Related packages php, libapache2-mod-php8.3

I updated packages on the Software Package Updates page, so php8.3, php8.3-*, libapache2-mod-php8.3 were automatically installed and worked in mod_php mode. Until then php7.4 was enabled in fcgid mode.

Here is the log:

apt-get -y install apparmor apport apt apt-utils base-files bolt distro-info dns-root-data fwupd fwupd-signed grub-common grub-pc grub-pc-bin grub2-common happo-agent hb-nagiosplugin-check-lsync-delay iptables iputils-ping iputils-tracepath isc-dhcp-client isc-dhcp-common kpartx landscape-common libapparmor1 libapt-pkg6.0 libargon2-1 libfwupd2 libfwupdplugin5 libgpgme11 libidn2-0 libip4tc2 libip6tc2 libmemcached11 libmemcachedutil2 libnetplan0 libnl-3-200 libnl-genl-3-200 libnss-systemd libpam-systemd libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpcre2-posix3 libpcre3 libpython2.7-minimal libpython2.7-stdlib libsnmp-base libsnmp35 libsystemd0 libtss2-esys0 libudev1 libunwind8 libxml2 libxtables12 libzip-dev libzstd1 linux-firmware ltrace mackerel-agent mackerel-agent-plugins motd-news-config multipath-tools netplan.io nfs-common php php-bz2 php-cgi php-cli php-common php-curl php-dev php-fpm php-gd php-mbstring php-mysql php-pear php-pgsql php-sqlite3 php-xml php-zip php7.4 php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-fpm php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-pgsql php7.4-readline php7.4-sqlite3 php7.4-xml php7.4-zip php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dev php8.2-fpm php8.2-gd php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-pgsql php8.2-readline php8.2-sqlite3 php8.2-xml php8.2-zip python-apt-common python2.7 python2.7-minimal python3-acme python3-apport python3-apt python3-debian python3-distro-info python3-distupgrade python3-gpg python3-problem-report python3-software-properties python3-tz python3-update-manager rsync sa-compile snapd snmp software-properties-common sosreport spamassassin spamc systemd systemd-sysv systemd-timesyncd tcpdump ubuntu-advantage-tools ubuntu-release-upgrader-core udev ufw unzip update-manager-core update-notifier-common usermin webmin webmin-jailkit webmin-virtual-server webmin-virtualmin-awstats webmin-virtualmin-htpasswd webmin-virtualmin-registrar

The output was as follows:

Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libpcre2-posix2 libxmlb1 libzip5
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libapache2-mod-php8.3 libclass-inspector-perl libclass-singleton-perl
  libdatetime-locale-perl libdatetime-perl libdatetime-timezone-perl
  libencode-detect-perl libfile-sharedir-perl libhashkit2 libqrencode4
  libxmlb2 lynx lynx-common **php8.3 php8.3-bz2 php8.3-cgi php8.3-cli
  php8.3-common php8.3-curl php8.3-dev php8.3-fpm php8.3-gd php8.3-mbstring
  php8.3-mysql php8.3-opcache php8.3-pgsql php8.3-readline php8.3-sqlite3
  php8.3-xml php8.3-zip qrencode ubuntu-pro-client ubuntu-pro-client-l10n
Suggested packages:
  apparmor-profiles-extra apparmor-utils apport-gtk | apport-kde apt-doc
  aptitude | synaptic | wajig shunit2 gir1.2-fwupd-2.0 multiboot-doc grub-emu
  xorriso desktop-base nftables traceroute resolvconf avahi-autoipd
  isc-dhcp-client-ddns snmp-mibs-downloader multipath-tools-boot
  network-manager | wpasupplicant openvswitch-switch watchdog dh-php
  python2.7-doc binfmt-support python-acme-doc python3-apt-dbg python-apt-doc
  zenity | kdialog razor pyzor libgeoip2-perl libnet-patricia-perl
  libbsd-resource-perl systemd-container
The following NEW packages will be installed:
  libapache2-mod-php8.3 libclass-inspector-perl libclass-singleton-perl
  libdatetime-locale-perl libdatetime-perl libdatetime-timezone-perl
  libencode-detect-perl libfile-sharedir-perl libhashkit2 libqrencode4
  libxmlb2 lynx lynx-common php8.3 php8.3-bz2 php8.3-cgi php8.3-cli
  php8.3-common php8.3-curl php8.3-dev php8.3-fpm php8.3-gd php8.3-mbstring
  php8.3-mysql php8.3-opcache php8.3-pgsql php8.3-readline php8.3-sqlite3
  php8.3-xml php8.3-zip qrencode ubuntu-pro-client ubuntu-pro-client-l10n
......

The dependencies showed php->php8.3->libapache2-mod-php8.3, and it seemed mod_php was enabled by libapache2-mod-php8.3.
I deleted the symbolic links to php8.3.conf and php8.3.load in /etc/apache2/mods-enabled/ and restarting apache2.

I suppose this happened because I updated the php package, but is it normal for a new version of php to be automatically installed?
Any information about this would be appreciated.
Thank you.

Hello,

You should revert any previous manual changes made and follow our tutorial for installing additional PHP versions.

Don’t do that! Nobody here ever told you to apt install php. (In fact, I tell people every couple of days to not do that. It’s in the guidelines, even.)

things like nextcloud might require more modules though. I never had problems installing them, but that was within php-fpm I guess.

I setup remi repo to replace outdated base with 8.3. Surely ubuntu has something similar. Unsure why it would now suggest 8.3 on its own.

That has nothing to do with installing php. That’s not a module, it’s a metapackage that pulls in at least one server API (we call this execution mode in Virtualmin), and libapache2-mod-php is the first one in the list of possibilities. You should never install it. Literally never.

Hello Joe and everyone else,
Thank you for the replies.
I get to know that apt install php should never be executed. By running this, I found that a series of packages for libapache2-mod-php and php8.3-* were newly installed.

But it doesn’t make sense.

I installed php8.2-* in August 2023 as written in the guidelines.

LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update
apt-get install php8.2-{bz2,cgi,cli,common,curl,dev,fpm,gd,mbstring,mysqlnd,opcache,pgsql,readline,sqlite3,xml,zip}

And I didn’t install php package manually, but it showed on “Software Package Updates” page as a package that needs updating. – It might be my fault that I didn’t pay enough attention and just left checked for update though.

I would just like to know why the php module was targeted for update, and what I should do.
The php8.2- and php8.3-related packages are not currently used so I can delete them if it does not affect existing packages.

Thank you.

You can purge using sudo apt purge php8.1* if you want to delete or have you done that?

Thank you for replying.
I’ll consider deleting them.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.