Wine 和 PHP-gd 因 libgd3 发生冲突

Wine 和 PHP-gd 因 libgd3 发生冲突

我最初在 Ubuntu 22.04 上安装了 wine,sudo apt install wine 然后尝试通过运行以下命令安装 PHP 8.2 及其一组扩展:

sudo apt-get install -y php8.2-cli php8.2-common php8.2-fpm php8.2-mysql php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml php8.2-bcmath

只会得到以下错误:

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.2-gd : Depends: libgd3 (>= 2.3.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后,我尝试通过安装手动解决 libgd3 的问题sudo apt-get install libgd3,但显示以下消息:

The following packages will be REMOVED:
  libgd3:i386 libgphoto2-6:i386 libwine:i386 wine32:i386

我无论如何都继续安装,然后通过运行检查 wine 是否存在任何问题wine --version并得到以下输出:

it looks like wine32 is missing, you should install it.
as root, please execute "apt-get install wine32"
wine-6.0.3 (Ubuntu 6.0.3~repack-1)

当我跑步的时候sudo apt-get install wine32

The following packages have unmet dependencies:
 libgphoto2-6:i386 : Depends: libgd3:i386 (>= 2.1.0~alpha~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install libgd3:i386因此我尝试通过运行以下命令安装 libgd3:i386 :

The following packages will be REMOVED:
  libgd3 libgphoto2-6 libwine wine wine64
The following NEW packages will be installed:
  libgd3:i386
0 upgraded, 1 newly installed, 5 to remove and 3 not upgraded.
Need to get 150 kB of archives.
After this operation, 562 MB disk space will be freed.

完全摆脱了葡萄酒。有谁知道这个悖论吗?

答案1

我遇到过类似的问题,原因是 libgd3 和 libgd3:i386 的版本不同(不知道为什么)。因此,首先检查您安装的 libgd3:i386 的版本

dpkg -s libgd3:i386|grep '^Version:'

之后,检查 repo 中可用的 libgd3 版本

apt-cache madison libgd3

如果在 repo 中找不到您安装的 libgd3:i386 版本,则必须将 libgd3:i386 降级为与 repo 中可用的任何 libgd3 版本匹配的版本。

例如这里我降级到2.3.0-2ubuntu2版本

sudo apt install libgd3:i386=2.3.0-2ubuntu2

然后,安装相同版本的 libgd3

sudo apt install libgd3=2.3.0-2ubuntu2

相关内容