3

I am trying to run a container and I have to install ruby:2.5-slim and I have a dependency on postgresql-client-9.4. When I try to install this, why am I getting the following error message?

Reading package lists...
E: Unable to locate package postgresql-client-10
ERROR: Service 'mobydock' failed to build: The command '/bin/sh -c apt-get update && apt-get install -qq -y build-essential nodejs libpq-dev postgresql-client-10 --fix-missing --no-install-recommends' returned a non-zero code: 100
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250

2 Answers2

2

I was able to solve this using the following command on a different Debian based image:

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
tfwright
  • 121
  • 2
0

Everything is explained here, dynamic compatibility with OS version:

https://www.postgresql.org/download/linux/debian/

Create the file repository configuration:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Import the repository signing key:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Update the package lists:

sudo apt-get update

Install the latest version of PostgreSQL.

If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':

sudo apt-get -y install postgresql
  • Welcome to the site, and thank you for your contribution. Please note that [link-only answers](https://unix.stackexchange.com/help/how-to-answer) are discouraged, as the link may become invalid or the linked content change. Please edit your answer to include at least a summary of the linked explanation. – AdminBee Jun 28 '21 at 10:10