Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

samehdev's avatar

how to install php 8.0.17 on ubuntu 22.04

Distributor ID: Ubuntu
Description:    Ubuntu Jammy Jellyfish (development branch)
Release:        22.04
Codename:       jammy

I have tried the following commands:

apt install php8.0

output

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'

And I don't want to install php 8.1 Is there any help?

0 likes
26 replies
sr57's avatar
            • apt install software-properties-common
            • add-apt-repository ppa:ondrej/php
            • apt update
            • apt install php8.0
samehdev's avatar

@sr57

add-apt-repository ppa:ondrej/php

Err:8 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release
  404  Not Found [IP: 2001:XXXXXXX 443]
Err:9 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release
  404  Not Found [IP: 2001:XXXXXXX 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

sr57's avatar

@samehdev

This method works for Ubuntu 20, try only

            • apt install software-properties-common
            • apt update
            • apt install php8.0
samehdev's avatar

@sr57 thanks same issue


Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'

Sinnbeck's avatar

First install this to get the latest version

sudo add-apt-repository ppa:ondrej/php

And then install the version you need. What webserver will you use? Nginx or apache?

Another solution would be to use docker, where you get everything in one

samehdev's avatar

@Sinnbeck

sudo add-apt-repository ppa:ondrej/php
Err:8 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Err:9 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

webserver : apache

As for the other docker solution, I have never used or learned about it

Sinnbeck's avatar

Seems it might not be needed on 22.04.

Try this perhaps

sudo apt install php8.0-common

If not try a search

apt-cache search php8.0
1 like
samehdev's avatar

@Sinnbeck

sudo apt install php8.0-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php8.0-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php8.0-common' has no installation candidate
apt-cache search php8.0
NO RESULT
Sinnbeck's avatar

Or try updating first

sudo apt update 
sudo apt install php8.0 
1 like
samehdev's avatar

@Sinnbeck

sudo apt update
Hit:1 http://us.clouds.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://us.clouds.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://us.clouds.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/canonical-kernel-team/unstable/ubuntu jammy InRelease
Ign:6 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy InRelease
Ign:7 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Err:8 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Err:9 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@Gooreo:~# sudo apt install php8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'

Sinnbeck's avatar

@samehdev only be reinstalling. You can upgrade not downgrade :)

I'll try looking around. Haven't tried 22.04 as I switched to Linux mint

Sinnbeck's avatar

Is this a local install on your computer or some server? I cannot find a single hit regarding this issue

What does this give you?

cat /etc/os-release 
1 like
samehdev's avatar

@Sinnbeck on server

PRETTY_NAME="Ubuntu Jammy Jellyfish (development branch)"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Sinnbeck's avatar

@samehdev who is the server with? Like a digital ocean droplet? Maybe I can try creating a server and see if it works for me

1 like
sr57's avatar

Can I change the ubuntu version?

Hope no and should be very strange.

Can you share your files

  • /etc/apt/sources.list
  • /ect/apt/sources.list.d/
samehdev's avatar

@sr57

cat /etc/apt/sources.list
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy universe
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://us.clouds.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse

cat: /ect/apt/sources.list.d: No such file or directory

sr57's avatar

@samehdev

Should be ok

Try

  • apt clean
  • apt update
  • apt install php8.0

Report any error(s) of these command

samehdev's avatar

@sr57

root@gooreo:~# apt clean
root@gooreo:~# apt update
Hit:1 https://dl.yarnpkg.com/debian stable InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://us.clouds.archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 http://us.clouds.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:5 http://us.clouds.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:6 https://ppa.launchpadcontent.net/canonical-kernel-team/unstable/ubuntu jammy InRelease
Ign:7 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy InRelease
Ign:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Err:9 https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Err:10 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release
  404  Not Found [IP: 2001:67c:1560:8008::19 443]
Reading package lists... Done
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/apache2/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@gooreo:~# apt install php8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'

sr57's avatar

@samehdev

There is a typo in my previous post

share /etc//ect/apt/sources.list.d/ ( and not ect )

or better delete in this directory the ppa.....list and redo the previous command.

krekas's avatar
krekas
Best Answer
Level 25

wait 22.04 version isn't released yet

1 like
krekas's avatar

@Sinnbeck no it isn't source

  • Feature Freeze: February 24, 2022
  • UI Freeze: March 17, 2022
  • Ubuntu 22.04 Beta: March 31, 2022
  • Kernel Freeze: April 7, 2022
  • Release Candidate: April 14, 2022

With the final release of Ubuntu 22.04 LTS on April 21, 2022.

Sinnbeck's avatar

@krekas ok cool. Didn't know. A Had only checked releases :). Weird that a hosting company (vultr) allows installing it then. Sounds like a bad idea. Sounds like a new server with 21.04 or similar is the best solution then

Please or to participate in this conversation.