ondrej/php PPA 'deprecated' error: moving to packages.sury.org

apt update fails because the ondrej/php PPA changed its Label to 'PPA for PHP (deprecated)'. Why it happens and how to switch an Ubuntu server to packages.sury.org cleanly.

apt update on my Ubuntu 24.04 droplets started failing with:

E: Repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble InRelease'
changed its 'Label' value from 'PPA for PHP' to 'PPA for PHP (deprecated)'

Ondřej Surý, who maintains the PHP packages most of us install on Ubuntu, is moving his Ubuntu builds off Launchpad and onto his own server, packages.sury.org, which already hosts his Debian packages. The label change is the announcement. apt refuses a repo whose metadata changed until you approve it, so updates stop.

For now:

  • noble (24.04) and jammy (22.04) are on both the PPA and packages.sury.org.
  • resolute (26.04) is only on packages.sury.org.

The PPA will stop getting updates at some point, so I switched rather than just accepting the new label. If you need updates working right now and will migrate later:

Terminal window
sudo apt-get update --allow-releaseinfo-change-label

Remove the PPA

Terminal window
sudo add-apt-repository --remove ppa:ondrej/php

On one server this left ondrej-ubuntu-php-noble.sources behind. Newer deb822 .sources files are sometimes only disabled, not deleted. Check, and remove it along with the old key:

Terminal window
ls /etc/apt/sources.list.d/
sudo rm -f /etc/apt/sources.list.d/ondrej-ubuntu-php-*.sources
sudo rm -f /etc/apt/trusted.gpg.d/ondrej-ubuntu-php*.gpg

Add packages.sury.org

Terminal window
sudo apt-get install -y ca-certificates curl lsb-release
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb
echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" \
| sudo tee /etc/apt/sources.list.d/sury-php.list
sudo apt update

Installed phpX.Y-* packages stay as they are. Their future updates come from Sury.

Watch for a duplicate

On one server apt update then warned:

Target Packages ... is configured multiple times

Some earlier guide or script had already added the same Sury line in a second file. apt doesn’t care what the file is called, only that the line appears once. Find the duplicates and keep one:

Terminal window
grep -rl packages.sury.org /etc/apt/sources.list.d/

When I was done, the only PHP repo file left in sources.list.d was sury-php.list, with no ondrej-ubuntu-php-* files.

If the old files come back

Every file in sources.list.d on that server had the same timestamp, which means something rewrites the whole folder: a control panel agent, cloud-init, a provisioning script or a cron job. If the Ondřej file or the duplicate reappears, fix it in that tool. Editing by hand won’t stick.