How To Install postgresql-server on Rocky Linux 8

In this tutorial we learn how to install postgresql-server on Rocky Linux 8. postgresql-server is The programs needed to create and run a PostgreSQL server

Introduction

In this tutorial we learn how to install postgresql-server on Rocky Linux 8.

What is postgresql-server

PostgreSQL is an advanced Object-Relational database management system (DBMS). The postgresql-server package contains the programs needed to create and run a PostgreSQL server, which will in turn allow you to create and maintain PostgreSQL databases.

We can use yum or dnf to install postgresql-server on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install postgresql-server.

Install postgresql-server on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install postgresql-server using dnf by running the following command:

sudo dnf -y install postgresql-server

Install postgresql-server on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install postgresql-server using yum by running the following command:

sudo yum -y install postgresql-server

How To Uninstall postgresql-server on Rocky Linux 8

To uninstall only the postgresql-server package we can use the following command:

sudo dnf remove postgresql-server

postgresql-server Package Contents on Rocky Linux 8

/etc/pam.d/postgresql
/etc/postgresql-setup
/etc/postgresql-setup/upgrade
/etc/postgresql-setup/upgrade/postgresql.conf
/usr/bin/initdb
/usr/bin/pg_basebackup
/usr/bin/pg_controldata
/usr/bin/pg_ctl
/usr/bin/pg_receivewal
/usr/bin/pg_recvlogical
/usr/bin/pg_resetwal
/usr/bin/pg_rewind
/usr/bin/postgres
/usr/bin/postgresql-setup
/usr/bin/postmaster
/usr/lib/.build-id
/usr/lib/.build-id/05/382c4687bf7db16fd729737238374365a712fd
/usr/lib/.build-id/07
/usr/lib/.build-id/07/ac578ca80c92b872a2bb083d9ef4efd9bfd981
/usr/lib/.build-id/0d
/usr/lib/.build-id/0d/8ff7f72ce6a2d2728982ebde6351c89046a234
/usr/lib/.build-id/0e
/usr/lib/.build-id/0e/f52af4158440cb762d5baa289c7e5a606b16c9
/usr/lib/.build-id/17
/usr/lib/.build-id/17/ecbc3490fa335538ccfd8906b48cceed4d1d6f
/usr/lib/.build-id/26
/usr/lib/.build-id/26/732b5b56797bcf8f7746afbc14665b92b1fe7a
/usr/lib/.build-id/29
/usr/lib/.build-id/29/0c1761560ef3fde8e02b9fa58f7ec903d9076a
/usr/lib/.build-id/2a
/usr/lib/.build-id/2a/bdddea6adbaa7a8ac8b1275e249b58388c68a9
/usr/lib/.build-id/2c
/usr/lib/.build-id/2c/6158967bfa9957f01b1709fb25a0510bdaabad
/usr/lib/.build-id/2e
/usr/lib/.build-id/2e/3570ba77514f4d40bab99ccc9459497ec839c8
/usr/lib/.build-id/33
/usr/lib/.build-id/33/f58efd5830022ad40d82d68b31c333c4e5152f
/usr/lib/.build-id/37
/usr/lib/.build-id/37/8490fcbea0c6b67edffe21e215b1f0b9cb9086
/usr/lib/.build-id/41
/usr/lib/.build-id/41/b85c53817c7b2db98ee0bb8a5ab94c89319650
/usr/lib/.build-id/48
/usr/lib/.build-id/48/cf6146e061964ac4580b64636e25e024b8dad4
/usr/lib/.build-id/52
/usr/lib/.build-id/52/e481f2e15716d5013bea0a39f1b54349acc39e
/usr/lib/.build-id/55
/usr/lib/.build-id/55/a4d20458e049fef3584a05890a05ae216f3b3d
/usr/lib/.build-id/5a
/usr/lib/.build-id/5a/8dbde060298eae561f005ff8111fd4c8329fd7
/usr/lib/.build-id/5b
/usr/lib/.build-id/5b/efe2394c28462bdc86d1fbbc0f5dd4834a8af3
/usr/lib/.build-id/61
/usr/lib/.build-id/61/0cac4f73ba12db7fbb8d0e5b7d1d7f163a44c1
/usr/lib/.build-id/64
/usr/lib/.build-id/64/9a9cfd843287ff78a43bb8571319dc21720416
/usr/lib/.build-id/75
/usr/lib/.build-id/75/82b5e75bcd26bdc9219fc52c308ae57dc41f5c
/usr/lib/.build-id/7c
/usr/lib/.build-id/7c/3e5c22919f2a2097d9321b2df2517f43f8ddf1
/usr/lib/.build-id/7f
/usr/lib/.build-id/7f/ef0e40ed9075450d60c5f591b4b2f9d6d6f384
/usr/lib/.build-id/80
/usr/lib/.build-id/80/1793d8663db5b130472b7f9df0fc981fe40ec9
/usr/lib/.build-id/83
/usr/lib/.build-id/83/39577d36c8da1227c26b0d1755411c838ecfe5
/usr/lib/.build-id/89
/usr/lib/.build-id/89/610e5132c3c83e9bec6e8a110ccafeb18be7da
/usr/lib/.build-id/8b/f734e1d937c5b1bba2ea7b6b7664b120356451
/usr/lib/.build-id/8c
/usr/lib/.build-id/8c/02843b3e5401db5c527591282902a33f9dd24b
/usr/lib/.build-id/90
/usr/lib/.build-id/90/2db6e66514d4f092b1d908a960052c20d2c5dd
/usr/lib/.build-id/94
/usr/lib/.build-id/94/3598ce6b2a77f70d290296ea054b443570fad6
/usr/lib/.build-id/a1
/usr/lib/.build-id/a1/00f3abb64dd50731f19063f9398d0439a1b110
/usr/lib/.build-id/a5
/usr/lib/.build-id/a5/c6e005cafc75933bccd90dab6c893f7eb6db66
/usr/lib/.build-id/af
/usr/lib/.build-id/af/829414a45ee933338e15ef9c1d59d24f1234ca
/usr/lib/.build-id/b4
/usr/lib/.build-id/b4/a517f54a195a840651afbfc60bad2e33f846af
/usr/lib/.build-id/bd/cc82d5e620765d82e25697e9331382ce5a7551
/usr/lib/.build-id/c1
/usr/lib/.build-id/c1/78b470c888773c5d784681b519e39e3e5d3b59
/usr/lib/.build-id/c6
/usr/lib/.build-id/c6/a972cad2eb873faf0b0dd070569a4aa088b490
/usr/lib/.build-id/ec
/usr/lib/.build-id/ec/c489bdae3eacd3dd7cc7e63866cd84f3431fef
/usr/lib/.build-id/ef
/usr/lib/.build-id/ef/c304d4fb072b4bf173dc90f915fa8d948048c1
/usr/lib/.build-id/f7
/usr/lib/.build-id/f7/0915c38a8719d6b3344b5058066956dd938af6
/usr/lib/systemd/system/postgresql.service
/usr/lib/systemd/system/[email protected]
/usr/lib/tmpfiles.d/postgresql.conf
/usr/lib64/pgsql/ascii_and_mic.so
/usr/lib64/pgsql/cyrillic_and_mic.so
/usr/lib64/pgsql/dict_snowball.so
/usr/lib64/pgsql/euc2004_sjis2004.so
/usr/lib64/pgsql/euc_cn_and_mic.so
/usr/lib64/pgsql/euc_jp_and_sjis.so
/usr/lib64/pgsql/euc_kr_and_mic.so
/usr/lib64/pgsql/euc_tw_and_big5.so
/usr/lib64/pgsql/latin2_and_win1250.so
/usr/lib64/pgsql/latin_and_mic.so
/usr/lib64/pgsql/libpqwalreceiver.so
/usr/lib64/pgsql/pg_prewarm.so
/usr/lib64/pgsql/pgoutput.so
/usr/lib64/pgsql/plpgsql.so
/usr/lib64/pgsql/utf8_and_ascii.so
/usr/lib64/pgsql/utf8_and_big5.so
/usr/lib64/pgsql/utf8_and_cyrillic.so
/usr/lib64/pgsql/utf8_and_euc2004.so
/usr/lib64/pgsql/utf8_and_euc_cn.so
/usr/lib64/pgsql/utf8_and_euc_jp.so
/usr/lib64/pgsql/utf8_and_euc_kr.so
/usr/lib64/pgsql/utf8_and_euc_tw.so
/usr/lib64/pgsql/utf8_and_gb18030.so
/usr/lib64/pgsql/utf8_and_gbk.so
/usr/lib64/pgsql/utf8_and_iso8859.so
/usr/lib64/pgsql/utf8_and_iso8859_1.so
/usr/lib64/pgsql/utf8_and_johab.so
/usr/lib64/pgsql/utf8_and_sjis.so
/usr/lib64/pgsql/utf8_and_sjis2004.so
/usr/lib64/pgsql/utf8_and_uhc.so
/usr/lib64/pgsql/utf8_and_win.so
/usr/libexec/initscripts/legacy-actions/postgresql
/usr/libexec/initscripts/legacy-actions/postgresql/initdb
/usr/libexec/initscripts/legacy-actions/postgresql/upgrade
/usr/libexec/postgresql-check-db-dir
/usr/sbin/postgresql-new-systemd-unit
/usr/share/locale/cs/LC_MESSAGES/initdb-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/cs/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/de/LC_MESSAGES/initdb-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/de/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/de/LC_MESSAGES/postgres-10.mo
/usr/share/locale/es/LC_MESSAGES/initdb-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/es/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/es/LC_MESSAGES/postgres-10.mo
/usr/share/locale/fr/LC_MESSAGES/initdb-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/fr/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/fr/LC_MESSAGES/postgres-10.mo
/usr/share/locale/he/LC_MESSAGES/initdb-10.mo
/usr/share/locale/he/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/he/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/it/LC_MESSAGES/initdb-10.mo
/usr/share/locale/it/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/it/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/it/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/it/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/it/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/it/LC_MESSAGES/postgres-10.mo
/usr/share/locale/ja/LC_MESSAGES/initdb-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/ja/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/ja/LC_MESSAGES/postgres-10.mo
/usr/share/locale/ko/LC_MESSAGES/initdb-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/ko/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/ko/LC_MESSAGES/postgres-10.mo
/usr/share/locale/pl/LC_MESSAGES/initdb-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/pl/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/pl/LC_MESSAGES/postgres-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/initdb-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/ro/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/ru/LC_MESSAGES/initdb-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/ru/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/ru/LC_MESSAGES/postgres-10.mo
/usr/share/locale/sv/LC_MESSAGES/initdb-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/sv/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/sv/LC_MESSAGES/postgres-10.mo
/usr/share/locale/tr/LC_MESSAGES/initdb-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_basebackup-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/tr/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/tr/LC_MESSAGES/postgres-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/initdb-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_controldata-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_ctl-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_resetwal-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_rewind-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/plpgsql-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/postgres-10.mo
/usr/share/locale/zh_TW/LC_MESSAGES/plpgsql-10.mo
/usr/share/man/man1/initdb.1.gz
/usr/share/man/man1/pg_basebackup.1.gz
/usr/share/man/man1/pg_controldata.1.gz
/usr/share/man/man1/pg_ctl.1.gz
/usr/share/man/man1/pg_receivewal.1.gz
/usr/share/man/man1/pg_resetwal.1.gz
/usr/share/man/man1/pg_rewind.1.gz
/usr/share/man/man1/postgres.1.gz
/usr/share/man/man1/postgresql-new-systemd-unit.1.gz
/usr/share/man/man1/postgresql-setup.1.gz
/usr/share/man/man1/postmaster.1.gz
/usr/share/pgsql
/usr/share/pgsql/contrib
/usr/share/pgsql/conversion_create.sql
/usr/share/pgsql/extension
/usr/share/pgsql/extension/plpgsql--1.0.sql
/usr/share/pgsql/extension/plpgsql--unpackaged--1.0.sql
/usr/share/pgsql/extension/plpgsql.control
/usr/share/pgsql/information_schema.sql
/usr/share/pgsql/pg_hba.conf.sample
/usr/share/pgsql/pg_ident.conf.sample
/usr/share/pgsql/postgres.bki
/usr/share/pgsql/postgres.description
/usr/share/pgsql/postgres.shdescription
/usr/share/pgsql/postgresql.conf.sample
/usr/share/pgsql/psqlrc.sample
/usr/share/pgsql/recovery.conf.sample
/usr/share/pgsql/snowball_create.sql
/usr/share/pgsql/sql_features.txt
/usr/share/pgsql/system_views.sql
/usr/share/pgsql/timezonesets
/usr/share/pgsql/timezonesets/Africa.txt
/usr/share/pgsql/timezonesets/America.txt
/usr/share/pgsql/timezonesets/Antarctica.txt
/usr/share/pgsql/timezonesets/Asia.txt
/usr/share/pgsql/timezonesets/Atlantic.txt
/usr/share/pgsql/timezonesets/Australia
/usr/share/pgsql/timezonesets/Australia.txt
/usr/share/pgsql/timezonesets/Default
/usr/share/pgsql/timezonesets/Etc.txt
/usr/share/pgsql/timezonesets/Europe.txt
/usr/share/pgsql/timezonesets/India
/usr/share/pgsql/timezonesets/Indian.txt
/usr/share/pgsql/timezonesets/Pacific.txt
/usr/share/pgsql/tsearch_data
/usr/share/pgsql/tsearch_data/danish.stop
/usr/share/pgsql/tsearch_data/dutch.stop
/usr/share/pgsql/tsearch_data/english.stop
/usr/share/pgsql/tsearch_data/finnish.stop
/usr/share/pgsql/tsearch_data/french.stop
/usr/share/pgsql/tsearch_data/german.stop
/usr/share/pgsql/tsearch_data/hungarian.stop
/usr/share/pgsql/tsearch_data/hunspell_sample.affix
/usr/share/pgsql/tsearch_data/hunspell_sample_long.affix
/usr/share/pgsql/tsearch_data/hunspell_sample_long.dict
/usr/share/pgsql/tsearch_data/hunspell_sample_num.affix
/usr/share/pgsql/tsearch_data/hunspell_sample_num.dict
/usr/share/pgsql/tsearch_data/ispell_sample.affix
/usr/share/pgsql/tsearch_data/ispell_sample.dict
/usr/share/pgsql/tsearch_data/italian.stop
/usr/share/pgsql/tsearch_data/norwegian.stop
/usr/share/pgsql/tsearch_data/portuguese.stop
/usr/share/pgsql/tsearch_data/russian.stop
/usr/share/pgsql/tsearch_data/spanish.stop
/usr/share/pgsql/tsearch_data/swedish.stop
/usr/share/pgsql/tsearch_data/synonym_sample.syn
/usr/share/pgsql/tsearch_data/thesaurus_sample.ths
/usr/share/pgsql/tsearch_data/turkish.stop
/usr/share/pgsql/tsearch_data/unaccent.rules
/usr/share/pgsql/tsearch_data/xsyn_sample.rules
/usr/share/postgresql-setup
/usr/share/postgresql-setup/library.sh
/var/lib/pgsql
/var/lib/pgsql/.bash_profile
/var/lib/pgsql/backups
/var/lib/pgsql/data
/var/run/postgresql

References

Summary

In this tutorial we learn how to install postgresql-server on Rocky Linux 8 using yum and dnf.