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:
sudo apt-get update --allow-releaseinfo-change-labelRemove the PPA
sudo add-apt-repository --remove ppa:ondrej/phpOn 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:
ls /etc/apt/sources.list.d/sudo rm -f /etc/apt/sources.list.d/ondrej-ubuntu-php-*.sourcessudo rm -f /etc/apt/trusted.gpg.d/ondrej-ubuntu-php*.gpgAdd packages.sury.org
sudo apt-get install -y ca-certificates curl lsb-releasecurl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.debsudo dpkg -i /tmp/debsuryorg-archive-keyring.debecho "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.listsudo apt updateInstalled 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 timesSome 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:
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.