pg gem on Ubuntu 22

I thought that installing pg gem on my clean Ubuntu 22 will be easy, but no. I got some weird message:

Bash
The following packages have unmet dependencies:
 libpq-dev : Depends: libpq5 (= 14.5-0ubuntu0.22.04.1) but 15.1-1.pgdg22.04+1 is to be installed
E: Unable to correct problems, you have held broken packages

So I tried to force installation:

Bash
sudo apt-get install libpq5=14.5-0ubuntu0.22.04.

After this:

Bash
sudo apt install libpq-dev
sudo gem install pg

On this Ubuntu 22 release installing Ruby interpreter from packages you got 3.0.2p107. The problem might be because of pgadmin4 which I installed before, so it could break something.

View as Markdown

All the content on this website is licensed under Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0). Cite as: Michał Sobczak, “pg gem on Ubuntu 22”, 2 December 2022, https://michalasobczak.pl/posts/pg-gem-on-ubuntu-22.html