0

Viewing the answer in this thread - How to install libpq-dev (14.0-1) on ubuntu 21.10? -

Just install the required version of libpq5 and reinstall libpq-dev:

sudo apt-get install libpq5=13.4-1 sudo apt-get install libpq-dev

How did the author know to set libpq5=13.4-1 ? I tried going over to the debian site https://www.debian.org/distrib/packages but was unable to figure out. For context, I want to install an older version of postgres with the libpq-dev dependency in an Ubuntu 18.04 (or Ubuntu 20.04) environment.

For extra context, I am looking to build a CI workflow around this - so you can think of this as needing to be done in a docker container, Github actions workflow, etc. A particular web framework being used by a legacy system (written in Ruby on Rails) has a specific version of a dependency (pg gem - https://rubygems.org/gems/pg/versions/0.18.4) that requires a specific version of postgres. For various reasons, we can't upgrade the legacy system at the moment.

Nona
  • 263
  • Hmmm... I'm not sure this is a good idea. You might break something using a version that's older than what's included in your version of Ubuntu. You can also break things by installing packages or adding sources from other distributions or other versions of Ubuntu. What is the reason you think you need this particular version? Double check to make sure this isn't an XY Problem – Nmath Apr 12 '22 at 23:45
  • If you need a specific version of PostgreSQL on your machine, you really want to look at using a Docker container as there's just too much that can go wrong once you start playing around with specific versions of libraries. You would also introduce a risk that future updates to the system could break the database, meaning people wouldn't want to run updates, which would lead to insecure systems. Use a Docker container on an up-to-date and well administered system, and you're golden – matigo Apr 12 '22 at 23:54
  • Thank you, updated the question - I need this to test an old system in a CI env like Github actions, so I'm doing it in a container, not on my specific machine. – Nona Apr 13 '22 at 00:11
  • I updated the context with more detail...it's to support a legacy system, that is why a specific version is necessary. I'm asking for more info on how to find a specific supporting linux package. Does that help? – Nona Apr 13 '22 at 00:27
  • 1
  • I hope you can see how this continues to get more and more complicated. You are in what is called "dependency hell" -- Your original question is asking how to obtain outdated software C, and when we asked why you needed it, you explain you need C to run outdated software B, and with further prompting, we learn you need B for outdated software A. But there's still no explanation about the actual task you're trying to accomplish and why it can't be done with the software that will actually run on your release. I would be willing to bet that you can, and this will save you a lot of headache – Nmath Apr 13 '22 at 01:27

0 Answers0