DEV Community

pallade
pallade

Posted on

ppa:ondrej/php on Ubuntu 23.04 (Lunar)

Ondrej's PPA is not meant to be run on non-LTS versions of Ubuntu. Despite what the docs state (they are unfortunately not up-to-date), he decided to target LTS versions only.

This said, you may still need to make it work, maybe temporarily. Here is how.

1: Add the PPA

sudo add-apt-repository ppa:ondrej/php

2: Edit /etc/apt/sources.list.d/ondrej-ubuntu-php-lunar.list and change lunar to jammy:

deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main

3: If you need the intl extension, download and manually install libicu70_70.1-2_amd64.deb from the jammy repository. It has no dependencies.

4: Pin libgd3 to the official Ubuntu version. Otherwise it will make a mess of your system (Ondrej's versio is newer, at the moment, but it has different and unsatisfiable dependencies, resulting in a "broken" package).

Create a file like this: /etc/apt/preferences.d/ondrejphp and paste this:

Package: libgd3
Pin: release n=lunar
Pin-Priority: 900
Enter fullscreen mode Exit fullscreen mode

5: install your PHP packages

Top comments (2)

Collapse
 
mcleishio profile image
Neil McLeish

Great info. Thank you!

Collapse
 
damienalexandre profile image
Damien Alexandre

It works, thanks a lot!