Malte Krupa


Ubuntu Is Making Fun of Me - 2022-05-18

In recent years I feel more and more like ubuntu is making fun of me.

Have a look at this example where I wanted to use psql to connect to a postgres database on a Ubuntu 20.04 LTS server.

$ psql

Command 'psql' not found, but can be installed with:

apt install postgresql-client-common
Please ask your administrator.

So far so good. Let’s install it like the computer tells us to:

$ sudo apt-get install postgresql-client-common
[...]

In a perfect world you would imagine that we’re done now and can continue our life.

Sadly:

$ psql
Warning: No existing cluster is suitable as a default target. Please see man
pg_wrapper(1) how to specify one.
Error: You must install at least one postgresql-client-<version> package

What? Wtf did I just install?

man 1 pg_wrapper

After wasting time reading this manpage I can tell you:

Apparently I installed a perl wrapper script which intercepts all postgres related commands. It tries to be smart about something that I didn’t even knew I needed: Having multiple versions of postgres installed at the same time. Cool, thanks computer.

Eventually, this saved the day:

$ sudo apt-get install postgresql-client-12

Sure, why bother writing about this, right? For years I just ignored every little failure of whatever Linux distribution I was using at the time, but after spending some time with FreeBSD I have to say that it’s just a pain to go back to Linux now. Maybe that would’ve been the better blog post.


Privacy Policy | Imprint