John Davidson

php - "The following packages have unmet dependencies" when installing php8.0

0 comments
Message:


I am trying to install php8.0 on my ubuntu VM, but I'm failing horribly. I have been following countless tutorials, such as this one, but I get stopped here when trying to run the sudo apt install php8.0-fpm (I have to use nginx).


What I get, is the following error:


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.


I have tried multiple solutions, like the ones shown here, but nothing seems to be fixing the problem (or to be modifying anything actually).


Here are my php version and ubuntu versions:


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

In case you need to also see my /etc/apt/sources.list file, leave a comment and I will add it.


Do you have any ideas that might work for me? I am not exactly the best Linux user, so in case you have an idea, can you also attach the commands that you want me to try? It would save me a lot of time and research.


Thank you!



My Answer:
It looks like the issue is with the libffi6 package not being installable. One possible solution is to try updating your package list and upgrading your packages before trying to install php8.0 again. You can do this by running the following commands:

bash
sudo apt update
sudo apt upgrade


After running these commands, try installing php8.0 again:

bash
sudo apt install php8.0-fpm


If you still encounter the same issue, you can try installing the libffi6 package manually. You can download the package from the Ubuntu package repository and install it using dpkg. Here's how you can do it:

1. Download the libffi6 package for your Ubuntu version (groovy) from the Ubuntu package repository:

bash
wget http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.3-4_amd64.deb


2. Install the libffi6 package using dpkg:

bash
sudo dpkg -i libffi6_3.3-4_amd64.deb


After installing the libffi6 package, try installing php8.0 again:

bash
sudo apt install php8.0-fpm


This should hopefully resolve the unmet dependencies issue you are facing. Let me know if you encounter any further issues.

Rate this post

5 of 5 based on 9239 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us