Closed garrettw closed 1 year ago
I'm guessing this was part of the apt-get update
in the appserver's build_as_root
; Lando's appserver
containers are built on Debian images, and I believe Debian comes with Postgres by default.
If someone is in a similar position, I'm guessing you could run an apt remove postgresql
or similar as an initial step.
Now I see why Alpine and other lean images are a thing ;)
The postgresql repository moved to apt-archive, as stated in https://apt-archive.postgresql.org/:
Distribution releases are moved here from apt.postgresql.org after they have been EOLed by Debian or Ubuntu.
Note that it also affects lando users that use drupal7 with postgresql, so apt remove postgresql
can not be a solution to those users.
If someone still has that issue, you need to fix postgresql /etc/apt/sources.list.d/pgdg.list
file by adding before the apt update
command in build_as_root
section the command echo "deb http://apt-archive.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
.
The .lando.yml
file should be something like the following one:
.lando.yml:
name: myapp
recipe: drupal7
config:
php: '7.3'
composer_version: '2.4.4'
via: apache:2.4
webroot: .
xdebug: true
database: mysql:5.7
config:
php: .lando/php/php.ini
services:
appserver:
ssl: true
build_as_root:
- echo "deb http://apt-archive.postgresql.org/pub/repos/apt/ $(grep -oP 'VERSION_CODENAME=\K\w+' /etc/os-release)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
- apt-get update
- apt-get install -y libcurl4-openssl-dev libxml2-dev
- printf "\n" | pecl install solr-2.5.1
- docker-php-ext-enable solr
pma:
type: phpmyadmin
hosts:
- database
proxy:
pma:
- pma.myapp.lndo.site
...I recently rebuilt a D7 app running on PHP 7.2 that has an apt-get update
in its build_as_root
instructions and got this error. My solution was to simply update to running PHP 7.4, since that image is on a more recent version of Debian that still has the postgres package listing, but @lmlima your solution is the most universal.
...hopefully going to address this in the underlying PHP base images, see https://github.com/lando/php/issues/130 for more details.
PostgreSQL should not be trying to install as I have nothing in my lando file asking for it.
Lando version: 3.1.4
.lando.yml:
The problematic part of the build output: