Subject: Re: Upgrade Ubuntu 22 -> 24 may break PostgreSQL

From: "Peter J. Holzer" <[email-masked]>
Date: Sat, 31 Aug 2024 20:02:13 +0200

On 2024-08-31 10:35:01 -0700, Adrian Klaver wrote:
> On 8/31/24 09:54, Peter J. Holzer wrote:
> > 'Tis the season again.
> > 
> > Ubuntu 24.04.1 has just been released, so many Ubuntu LTS users will now
> > be prompted to upgrade from 22.04 to 24.04.
> 
> Which I ignore.

At some point I do want to upgrade. Not necessarily at the earliest
oportunity, but for workstations/laptops I'm usually rather quick. This
laptop was originally delivered with a pre-installed Ubuntu 18.04 LTS,
and has since been upgraded to 20.04, 22.04 and now 24.04. Servers are
different. They are usually upgraded when neccessary. Or sometimes new
hardware is ready before support ends ...

But I think our personal preferences are besides the point. Many people
will upgrade Ubuntu in the next weeks or months. So I wanted to give
them a heads-up that this might not be as smooth as expected.

> > A word of warning to those who use Postgresql from the Ubuntu repo (not
> > PGDG):
> 
> Why I do use the PGDG repo's.

So do I on production systems. But this was just my personal laptop.
But yeah, it reminded me that one of the reasons I prefer the PGDG repos
is that they decouple PostgreSQL upgrades from OS upgrades.

> > As usual, a newer Ubuntu version comes with a newer Postgres version (16
> > instead of 14). Also as usual, I got a message during the upgrade that
> > Postgres 14 is obsolete,. but the binaries have been left installed and
> > I should upgrade to Postgres 16 manually ASAP.
> > 
> > But after the reboot, PostgreSQL failed to start because it needed a
> > shared library (libldap) which was no longer there. So a normal
> > pg_upgradecluster wouldn't work.
> 
> sudo apt install libldap-X.x did not work?

It might have worked after reenabling the Ubuntu 22 repo. Or it might
have worked to simply symlink to the newer libldap. Frankly I didn't
try. I had a VM with ubuntu 22 without postgres lying around, so that
seemed like the safeste route.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | [email-masked]         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

---

From: Adrian Klaver <[email-masked]>
Date: Sun, 1 Sep 2024 09:22:31 -0700

> them a heads-up that this might not be as smooth as expected.

Major updates rarely are. That is why I tend to look before I leap. One 
way to make the leap easier is to change the Postgres repo from the 
Ubuntu to the PGDG repo on the current Ubuntu version being run then do 
the Ubuntu upgrade. The caveat being what the current version of 
Ubuntu/Postgres is you are running and whether that Postgres version is 
still supported in the main PGDG repo. Otherwise you are going to:

https://apt-archive.postgresql.org/

-- 
Adrian Klaver
[email-masked]