似乎由于更高级的(??(依赖性,它无法安装php8.1-gd--不建议安装";但我没帮上忙。
此外,我有ubuntu 18,并升级到22(通过20(,也许这是问题的根源?
> sudo apt install php8.1-gd
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-gd : Depends: php8.1-common (= 8.1.2-1ubuntu2.4) but 8.1.8-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
好吧,我在发布问题几分钟后就解决了这个问题。
我删除了";php8.1-公共"我有一种感觉很糟糕(它指的是ubuntu 18的包裹(。
sudo apt remove php8.1-common
和php8.1 gd安装没有问题!
sudo apt install php8.1-gd
它还安装了php8.1-common作为依赖项。
这里的问题是您(可能是无意中(告诉apt
不要更新php8.1-common
包。由于php-8.1-gd
需要更新的版本,apt
将检查它是否可以下载该更新的版本。但由于不允许这样做,它最终会处于一种既不能安装新版本又不能安装新软件包的状态。
通过告诉apt
卸载程序包,您就消除了对程序包的限制。另一种选择是进行sudo apt-mark unhold php-8.1-common
(见此处接受的答案(