DEV Community

Vincent Tommi
Vincent Tommi

Posted on

How to Fix the Ondřej PHP PPA 404 Error on Ubuntu

How to Fix the Ondřej PHP PPA 404 Error on Ubuntu

If you are using Ubuntu and run:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

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.
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

APT tries to access:

https://ppa.launchpadcontent.net/ondrej/php/ubuntu/resolute
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

You can also run:

cat /etc/os-release
Enter fullscreen mode Exit fullscreen mode

Look for the release codename.

For example:

VERSION_CODENAME=resolute
Enter fullscreen mode Exit fullscreen mode

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/
Enter fullscreen mode Exit fullscreen mode

You may see something similar to:

ondrej-ubuntu-php-resolute.sources
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

For example:

PHP 8.5.x (cli)
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

and:

Updating from such a repository can't be done securely,
and is therefore disabled by default.
Enter fullscreen mode Exit fullscreen mode

Leaving broken repositories in your configuration can cause unnecessary errors whenever you run:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Then verify:

php -v
Enter fullscreen mode Exit fullscreen mode

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)