I'm having trouble getting PHP 7.4 to install on 18.04 now, as it seems to depend on a version of libc6
that is not available on 18.04.
I have no tried building from source as I would like to avoid that if possible.
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4-fpm
results in
The following packages have unmet dependencies:
php7.4-fpm : Depends: php7.4-cli but it is not going to be installed
Depends: php7.4-common (= 7.4.22-1+ubuntu20.04.1+deb.sury.org+1) but it is not going to be installed
Depends: php7.4-json but it is not going to be installed
Depends: php7.4-opcache but it is not going to be installed
Depends: libc6 (>= 2.29) but 2.27-3ubuntu1.4 is to be installed
E: Unable to correct problems, you have held broken packages.
If I look specifically at lib6c we can see there is nothing available to satisfy the version requirement:
$ sudo apt-cache policy libc6
libc6:
Installed: 2.27-3ubuntu1.4
Candidate: 2.27-3ubuntu1.4
Version table:
*** 2.27-3ubuntu1.4 500
500 http://us-east1.gce.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
100 /var/lib/dpkg/status
2.27-3ubuntu1.2 500
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
2.27-3ubuntu1 500
500 http://us-east1.gce.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Best Answer
This may not be very helpful, but I was able to install php7.4-fpm on Ubuntu 18.04LTS with no errors. I originally needed php7.4 for use with Matomo. I used this writeup Update to PHP 7.4 on Ubuntu 18.04 on Digital Ocean for WordPress as applicable to my setup.
I didn't technically need the php7.4-fpm, but decided to test it after seeing this post. Installed with no issues reported. Here's what I have:
Ubuntu
libc6
php7.4-fpm
And the full report from php7.4-fpm install: