I use WSL2 Ubuntu 22.04 LTS and tried to install the PHP 8.2.
sudo add-apt-repository ppa:ondrej/phpsudo apt updatesudo apt upgradesudo apt install php8.2
then the error is follow.
libapache2-mod-php8.2 depends on php8.2-common (= 8.2.8-1+ubuntu22.04.1+deb.sury.org+1); however: Package php8.2-common is not configured yet. libapache2-mod-php8.2 depends on php8.2-opcache; however: Package php8.2-opcache is not configured yet.dpkg: error processing package libapache2-mod-php8.2 (--configure): dependency problems - leaving unconfigureddpkg: dependency problems prevent configuration of php8.2-cli: php8.2-cli depends on php8.2-common (= 8.2.8-1+ubuntu22.04.1+deb.sury.org+1); however: Package php8.2-common is not configured yet. php8.2-cli depends on php8.2-opcache; however: Package php8.2-opcache is not configured yet. php8.2-cli depends on php8.2-readline; however: Package php8.2-readline is not configured yet.dpkg: error processing package php8.2-cli (--configure): dependency problems - leaving unconfiguredProcessing triggers for man-db (2.10.2-1) ...Errors were encountered while processing: php8.2-common php8.2-opcache php8.2-readline php8.2 libapache2-mod-php8.2 php8.2-cliE: Sub-process /usr/bin/dpkg returned an error code (1)
I tried the commands for reinstall the PHP:
sudo apt remove --purgesudo apt autoremovesudo apt autocleansudo apt updatesudo apt install php8.2
then error is same.
The follow is my package list for PHP. (dpkg -l | grep \php
)
iU libapache2-mod-php8.2 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)ii php-common 2:93+ubuntu22.04.1+deb.sury.org+2 all Common files for PHP packagesiU php8.2 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)iU php8.2-cli 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting languageiF php8.2-common 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHPiU php8.2-opcache 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHPiU php8.2-readline 8.2.8-1+ubuntu22.04.1+deb.sury.org+1 amd64 readline module for PHP
I tried the various commands:
sudo apt remove --purge [packagename]sudo apt autoremovesudo apt autocleansudo dpkg --purge [packagename]sudo dpkg --configure -a