3

I use WSL2 Ubuntu 22.04 LTS and tried to install the PHP 8.2.

sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt upgrade
sudo 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 unconfigured
dpkg: 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 unconfigured
Processing 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-cli
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried the commands for reinstall the PHP:

sudo apt remove --purge
sudo apt autoremove
sudo apt autoclean
sudo apt update
sudo 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 packages
iU  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 language
iF  php8.2-common                  8.2.8-1+ubuntu22.04.1+deb.sury.org+1         amd64        documentation, examples and common module for PHP
iU  php8.2-opcache                 8.2.8-1+ubuntu22.04.1+deb.sury.org+1         amd64        Zend OpCache module for PHP
iU  php8.2-readline                8.2.8-1+ubuntu22.04.1+deb.sury.org+1         amd64        readline module for PHP

Thanks for your help!

I tried the various commands:

sudo apt remove --purge [packagename]
sudo apt autoremove
sudo apt autoclean
sudo dpkg --purge [packagename]
sudo dpkg --configure -a
Sel
  • 31
  • 2
  • 1
    That would be better off on askubuntu.com, since it's not about programming but about system administration. Searching for the error message online also helps. BTW, read the description of the tags you apply. Also, as a new user here, take the [tour] and read [ask]. – Ulrich Eckhardt Jul 30 '23 at 14:14

0 Answers0