Del*_*iki 1 php linux ubuntu php-8 ubuntu-20.10
我正在尝试在我的 ubuntu 虚拟机上安装 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.
Run Code Online (Sandbox Code Playgroud)
我已经尝试了多种解决方案,例如此处所示的解决方案,但似乎没有任何解决方案可以解决问题(或实际上可以修改任何内容)。
这是我的 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
Run Code Online (Sandbox Code Playgroud)
如果您还需要查看我的 /etc/apt/sources.list 文件,请发表评论,我将添加它。
您有什么可能对我有用的想法吗?我并不是最好的 Linux 用户,所以如果你有想法,可以附上你想让我尝试的命令吗?这会节省我大量的时间和研究。
谢谢你!
Del*_*iki 10
我终于解决了。我必须手动安装“libffi”库和其他一些缺失的库:
wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
Run Code Online (Sandbox Code Playgroud)
下载后,我运行:
dpkg -i libffi6_3.2.1-8_amd64.deb
Run Code Online (Sandbox Code Playgroud)
希望这对某人有帮助。