Postgres - SLES Repo Configuration

You can use the zypper package manager to install Postgres and/or other components on an SLES 15 / SLES 12 host. zypper will attempt to satisfy package dependencies as it installs a package, but some components (mainly PostGIS) require access to specific repositories that are not hosted at postgresql.org or SLES official repositories:

  • uuid, libjson-c5 : zypper addrepo https://download.opensuse.org/repositories/devel:/libraries:/c_c++/15.6/devel:libraries:c_c++.repo
  • cfitsio, armadillo, netcdf, hdf5 libqt4 : zypper addrepo https://download.opensuse.org/repositories/science/15.6/science.repo
  • spatialite-tools (for libosmium) : zypper addrepo https://download.opensuse.org/repositories/Application:/Geo/15.6/Application:Geo.repo

  • freetds-devel (for developers): zypper addrepo https://download.opensuse.org/repositories/devel:languages:misc/SLE_15_SP4/devel:languages:misc.repo

Also add SUSEConnect and the SUSE Package Hub extension to the SLES host, and register the host with SUSE, allowing access to SUSE repositories. Use these commands:
SLES 15 SP 6:
zypper install SUSEConnect
SUSEConnect -p sle-module-desktop-applications/15.6/x86_64
SUSEConnect -p PackageHub/15.6/x86_64

SLES 15 SP5:
zypper install SUSEConnect
SUSEConnect -p sle-module-desktop-applications/15.5/x86_64
SUSEConnect -p PackageHub/15.5/x86_64

SLES 12:
zypper install SUSEConnect
SUSEConnect -p PackageHub/12/x86_64
SUSEConnect -p sle-sdk/12/x86_64

For detailed information about registering a SUSE host, visit: https://www.suse.com/support/kb/doc/?id=7016626.

To install Postgres and/or other components, run the following commands to add Postgres community repository configuration files to your SLES host:

  • SLES 15: rpm --import https://zypp.postgresql.org/keys/PGDG-RPM-GPG-KEY-SLES15; zypper install https://download.postgresql.org/pub/repos/zypp/reporpms/SLES-15-x86_64/pgdg-suse-repo-latest.noarch.rpm
SLES 12:

  • SLES 12 / Postgres 15: zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-12-pg15.repo
  • SLES 12 / Postgres 14: zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-12-pg14.repo
  • SLES 12 / Postgres 13: zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-13.repo
  • SLES 12 / Postgres 12: zypper addrepo https://download.postgresql.org/pub/repos/zypp/repo/pgdg-sles-12.repo

After creating the repository configuration files, use the zypper refresh command to refresh the metadata on your SLES host to include the Postgres SUSE repositories:

zypper refresh

Installing Postgres on SLES host

After adding the repo, use the following command to install Postgres on the SLES host:

Postgres 17:

Postgres 17:

zypper install postgresql16-server

Postgres 15:

zypper install postgresql15-server

Please take a look at the Postgres SuSE package list to see what other packages are available in the repository.