How to Fix the Ondřej PHP PPA 404 Error on Ubuntu
If you are using Ubuntu and run:
sudo apt update
you may sometimes encounter an error similar to this:
Ign:1 https://ppa.launchpadcontent.net/ondrej/php/ubuntu resolute InRelease
Err:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu resolute Release
404 Not Found
Error: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu resolute Release'
does not have a Release file.
This article explains why this happens and how to fix it safely.
Understanding the Error
The problem is caused by the Ondřej PHP PPA being configured for an Ubuntu release that it does not currently support.
In this case, the system is using:
resolute
APT tries to access:
https://ppa.launchpadcontent.net/ondrej/php/ubuntu/resolute
but the repository does not contain a Release file for resolute.
As a result, Ubuntu disables the repository because it cannot securely verify and retrieve packages from it.
Step 1: Check Your Ubuntu Version
First, confirm the Ubuntu release you're running:
lsb_release -a
You can also run:
cat /etc/os-release
Look for the release codename.
For example:
VERSION_CODENAME=resolute
This confirms that your system is using Ubuntu resolute.
Step 2: Check the Ondřej PHP Repository
List the repository configuration files:
ls /etc/apt/sources.list.d/
You may see something similar to:
ondrej-ubuntu-php-resolute.sources
This file is responsible for the broken PHP PPA configuration.
Step 3: Remove the Unsupported Repository
If you don't need the repository, remove it with:
sudo rm /etc/apt/sources.list.d/ondrej-ubuntu-php-resolute.sources
This does not uninstall PHP.
It only removes the repository from which APT was trying to download packages.
Step 4: Run apt update Again
Now run:
sudo apt update
The previous error should be gone.
You should see output similar to:
Hit:1 http://security.ubuntu.com/ubuntu resolute-security InRelease
Hit:2 http://ke.archive.ubuntu.com/ubuntu resolute InRelease
Hit:3 http://ke.archive.ubuntu.com/ubuntu resolute-updates InRelease
Hit:4 http://ke.archive.ubuntu.com/ubuntu resolute-backports InRelease
Reading package lists... Done
Step 5: Check for Other Ondřej PHP Entries
It's a good idea to make sure there aren't other configuration files pointing to the same unsupported repository.
Run:
grep -R "ondrej/php" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null
If nothing is returned, there are no remaining Ondřej PHP repository entries.
Does Removing the Repository Remove PHP?
No.
Removing the repository does not remove your existing PHP installation.
You can verify your PHP version with:
php -v
For example:
PHP 8.5.x (cli)
Your installed PHP continues to work normally.
The only difference is that APT will no longer attempt to download packages from the unsupported Ondřej repository.
Check Available PHP Packages
You can also check which PHP version Ubuntu currently provides:
apt policy php
This is useful before installing or upgrading PHP packages.
Why You Shouldn't Ignore the Error
You might be tempted to leave the repository configured and ignore the 404 error.
That's not recommended.
APT is explicitly telling you:
does not have a Release file
and:
Updating from such a repository can't be done securely,
and is therefore disabled by default.
Leaving broken repositories in your configuration can cause unnecessary errors whenever you run:
sudo apt update
It is better to remove or correct the repository configuration.
Conclusion
The 404 Not Found error from the Ondřej PHP PPA occurs because the configured Ubuntu release does not have a corresponding repository on that PPA.
The simplest solution is:
sudo rm /etc/apt/sources.list.d/ondrej-ubuntu-php-resolute.sources
sudo apt update
Then verify:
php -v
Remember that removing the repository does not uninstall PHP. It simply stops APT from trying to use an unsupported package source.
If you are developing Laravel applications and need a specific PHP version such as PHP 8.3, 8.4, or 8.5, make sure the PHP version you choose is compatible with your Laravel and Composer dependencies before changing your system PHP installation.
Top comments (0)