I am trying to install postgresql on a new Ubuntu 24.04 machine. I'm surprised that after
$ sudo apt update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu noble InRelease
Get:4 http://us.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:5 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease [7,532 B]
Hit:6 http://us.archive.ubuntu.com/ubuntu noble-backports InRelease
Get:7 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease [7,468 B]
Get:8 http://us.archive.ubuntu.com/ubuntu noble-updates/universe i386 Packages [167 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [384 kB]
Get:10 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease [7,462 B]
Get:11 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 c-n-f Metadata [14.9 kB]
Get:12 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease [7,461 B]
Fetched 721 kB in 1s (497 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
this fails:
$ sudo apt install postgresql
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package postgresql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'postgresql' has no installation candidate
As far as I can tell, this package should be available and the above is unexpected. I must've done something to mess up my machine, but I'm not sure what. Any help is appreciated.
I do not know how this happened but the "Software & Updates" app showed that somehow the "Canonical-supported free and open-source software (main)" was deselected. Selecting, updating & installing then worked as expected.
Thanks to all who commented & let me know this should work.