I've Ubuntu 16.04, and I ran the below command
sudo add-apt-repository ppa:ondrej/php
The final result looks like this:
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp94jbo60i/secring.gpg' created
gpg: keyring `/tmp/tmp94jbo60i/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp94jbo60i/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
then I run this:
sudo apt-get update
The result of this command is:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Hit:4 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security InRelease
Hit:5 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Hit:7 http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial InRelease
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
and then I run this code to install php8.0:
sudo apt install php8.0-fpm libapache2-mod-fcgid
It always returns:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.0-fpm
E: Couldn't find any package by glob 'php8.0-fpm'
E: Couldn't find any package by regex 'php8.0-fpm'
I highly appreciate it if anyone knows and shares the solution.