I know a lot of topics have the same question but I've tried everything and nothing works for me. So I'm trying to install php 7.4 on my ubuntu stretch. I've done the following commands I found on the Internet:
apt install ca-certificates apt-transport-https wget gnupg
wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
echo "deb https://packages.sury.org/php/ buster main" | tee /etc/apt/sources.list.d/php.list
apt update
apt install php7.4
And then I get the 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:
php7.4 : Depends: libapache2-mod-php7.4 but it is not going to be installed or
php7.4-fpm but it is not going to be installed or
php7.4-cgi but it is not going to be installed
Depends: php7.4-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I saw that someone followed the error by trying to install the depedencies that were causing the problem. So I then did
apt install php7.4-common
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:
php7.4-common : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
I saw somewhere that it could be something in my /etc/apt/sources.list so here it is:
# Generated by distrobuilder
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
I'm stuck, I don't see what's wrong. Could you help? Thanks
please try below commands for Ubuntu:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With