Except when you need a different version of postgresql than the one packaged by Ubuntu, you have to use ppas or something even more horrific: snaps. Otherwise you just put your stuff in a container, problem solved. I'm not for containerizing everything, it just adds useless complexity. But it's a useful tool.