Hi there,
I’m running into an issue with existing (older) trellis projects that still run on Ubuntu 20.04.
Whenever I try to spin up a new VM on an existing project with trellis init
and trellis up
I’m getting this error:
TASK [php : Install PHP and extensions] ****************************************
failed: [default] (item=php8.2-bcmath) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-bcmath", "value": "present"}, "msg": "No package matching 'php8.2-bcmath' is available"}
failed: [default] (item=php8.2-cli) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-cli", "value": "present"}, "msg": "No package matching 'php8.2-cli' is available"}
failed: [default] (item=php8.2-curl) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-curl", "value": "present"}, "msg": "No package matching 'php8.2-curl' is available"}
failed: [default] (item=php8.2-dev) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-dev", "value": "present"}, "msg": "No package matching 'php8.2-dev' is available"}
failed: [default] (item=php8.2-fpm) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-fpm", "value": "present"}, "msg": "No package matching 'php8.2-fpm' is available"}
failed: [default] (item=php8.2-imagick) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-imagick", "value": "present"}, "msg": "No package matching 'php8.2-imagick' is available"}
failed: [default] (item=php8.2-intl) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-intl", "value": "present"}, "msg": "No package matching 'php8.2-intl' is available"}
failed: [default] (item=php8.2-mbstring) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-mbstring", "value": "present"}, "msg": "No package matching 'php8.2-mbstring' is available"}
failed: [default] (item=php8.2-mysql) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-mysql", "value": "present"}, "msg": "No package matching 'php8.2-mysql' is available"}
failed: [default] (item=php8.2-xml) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-xml", "value": "present"}, "msg": "No package matching 'php8.2-xml' is available"}
failed: [default] (item=php8.2-xmlrpc) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-xmlrpc", "value": "present"}, "msg": "No package matching 'php8.2-xmlrpc' is available"}
failed: [default] (item=php8.2-zip) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "php8.2-zip", "value": "present"}, "msg": "No package matching 'php8.2-zip' is available"}
I’m pretty sure it has to do with the fact that Ubuntu 20.04 has reached end-of-life support
for it’s LTS standard security maintenance in May 2025:
Because of that, the ppa:ondrej/php
package is unable to install PHP or any extensions on Focal Fossa:
https://stackoverflow.com/questions/79709025/faild-to-install-php-8-3-on-ubuntu-20-04
Also re-provisioning any remote server running on Ubuntu Focal Fossa results in this error:
TASK [common : Update apt packages] ********************************************
fatal: [167.172.45.117]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: W:This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details., E:Repository 'http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease' changed its 'Label' value from '***** The main PPA for supported PHP versions with many PECL extensions *****' to 'PPA for PHP'"}
But I can fix that by running sudo apt update
and accepting the changes in the http://ppa.launchpad.net/ondrej/php/ubuntu
repository.
Locally it’s easy for me to update to Ubuntu 24.04 LTS, that fixes the [php : Install PHP and extensions]
task, however I have at least 20+ live droplets running on Ubuntu 20.04 still.
It’s a LOT of work to create new droplets for each one of them and sync all content especially since we don’t control the DNS records for a lot of our clients.
So my question basically is;
Is there a workaround to keep running existing Ubuntu 20.04 projects with a different PHP package? Or is there a smarter way to upgrade existing droplets to Ubuntu 22.04 or 24.04?
I’m aware you can do it with sudo do-release-upgrade
following this guide:
https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-22-04-jammy-jellyfish
But I’m a bit hesitant to do this on live droplets.
Any insights are appreciated.
Thanks!