-2

我正在尝试在我的 ubuntu VM 上安装 php8.0,但我失败了。我一直在关注无数的教程,比如这个,但是当我尝试运行时我在这里停下来sudo apt install php8.0-fpm(我必须使用 nginx)。

我得到的是以下错误:

Reading package lists... Done
Building dependency tree     
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.0-common : Depends: libffi6 (>= 3.0.10~rc8) but it is not installable
E: Unable to correct problems, you have held broken packages.

我已经尝试了多种解决方案,就像这里显示的那样,但似乎没有任何东西可以解决问题(或者实际上是在修改任何东西)。

这是我的php版本和ubuntu版本:

php -v
PHP 7.4.21 (cli) (built: Jul  1 2021 16:09:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.10
Release:        20.10
Codename:       groovy

如果您还需要查看我的 /etc/apt/sources.list 文件,请发表评论,我会添加它。

你有什么想法可能对我有用吗?我不是最好的 Linux 用户,所以如果你有想法,你可以附上你想让我尝试的命令吗?这将节省我大量的时间和研究。

谢谢!

4

1 回答 1

5

我设法最终解决了它。我不得不手动安装“libffi”库和其他一些缺少的库:

wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb

下载后,我运行:

dpkg -i libffi6_3.2.1-8_amd64.deb

希望这可以帮助某人。

于 2021-09-03T09:54:05.330 回答