
$ sudo apt install php8.1-bcmath
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php8.1-bcmath : Depends: php8.1-common (= 8.1.2-1ubuntu2.14) but 8.1.18-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Na verdade, tenho 8.1.18-1 + ubuntu18.04.1, mas não vejo como atualizar para 8.1.2-1ubuntu2.14. Eu executei o apt update e o apt upgrade. Quando tento reinstalar o php, recebo isto:
$ sudo apt reinstall php8.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reinstallation of php8.1 is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Responder1
Você está usando os deb.sury.org
repositórios PHP/PPAs.
A bcmath
biblioteca NÃO está disponível nos repositórios sury.org, e está disponível apenas como parte dos repositórios do Ubuntu. Você não pode misturar e combinar os pacotes PHP 8.1 no repositório Ubuntu com as deb.sury.org
principais bibliotecas PHP dos repositórios.
Os deb.sury.org
repositórios precisam fornecer uma versão atualizada do php8.1-bcmath
, ou você precisa remover os deb.sury.org
repositórios PHP e reverter para o PHP 8.1.2 dos repositórios do Ubuntu.
Não há outra solução “híbrida” aqui.