How To Install postgresql on Rocky Linux 8

In this tutorial we learn how to install postgresql on Rocky Linux 8. postgresql is PostgreSQL client programs

Introduction

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

What is postgresql

PostgreSQL is an advanced Object-Relational database management system (DBMS). The base postgresql package contains the client programs that you’ll need to access a PostgreSQL DBMS server, as well as HTML documentation for the whole system. These client programs can be located on the same machine as the PostgreSQL server, or on a remote machine that accesses a PostgreSQL server over a network connection. The PostgreSQL server can be found in the postgresql-server sub-package.

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

Install postgresql 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 using dnf by running the following command:

sudo dnf -y install postgresql

Install postgresql 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 using yum by running the following command:

sudo yum -y install postgresql

How To Uninstall postgresql on Rocky Linux 8

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

sudo dnf remove postgresql

postgresql Package Contents on Rocky Linux 8

/usr/bin/clusterdb
/usr/bin/createdb
/usr/bin/createuser
/usr/bin/dropdb
/usr/bin/dropuser
/usr/bin/pg_dump
/usr/bin/pg_dumpall
/usr/bin/pg_isready
/usr/bin/pg_restore
/usr/bin/pg_upgrade
/usr/bin/psql
/usr/bin/reindexdb
/usr/bin/vacuumdb
/usr/lib/.build-id
/usr/lib/.build-id/05
/usr/lib/.build-id/05/bcc7f8a631c83d696d9de9b1f3ca6f8b7f8a5e
/usr/lib/.build-id/1c
/usr/lib/.build-id/1c/53bf8dc78119c5c11331f8addf8d734a10a8f8
/usr/lib/.build-id/23
/usr/lib/.build-id/23/f8e9d4f9f8602d63825062add780de62c327b2
/usr/lib/.build-id/49
/usr/lib/.build-id/49/08770a0ed789b89da46da694092a449b4bc709
/usr/lib/.build-id/4e
/usr/lib/.build-id/4e/487f2890929ec79c53899948529c61126be664
/usr/lib/.build-id/63
/usr/lib/.build-id/63/4dbd70a944839aea66e698fdc60754952ff30f
/usr/lib/.build-id/8b
/usr/lib/.build-id/8b/61ff5f3eecde2aefde281c0f9f2894967c58ce
/usr/lib/.build-id/9b
/usr/lib/.build-id/9b/7a6618c8e2f52238f22ec5e99470446a517f05
/usr/lib/.build-id/a0
/usr/lib/.build-id/a0/5a8d3c5ba84fe6a6bfc6787f00d2d93b8bc219
/usr/lib/.build-id/bd
/usr/lib/.build-id/bd/2d4c700aa9e0e107fad8105cc16bcd4a6acb1a
/usr/lib/.build-id/db
/usr/lib/.build-id/db/54914f1b1c288d63e24046f2ac918ac445e71b
/usr/lib/.build-id/e9
/usr/lib/.build-id/e9/8d2af4cce8f7eb1f2eafffd4fe73e6a87d5c12
/usr/lib/.build-id/ee
/usr/lib/.build-id/ee/8f95207855823a6259dfcae239cca4733cf8b2
/usr/share/doc/postgresql
/usr/share/doc/postgresql/COPYRIGHT
/usr/share/doc/postgresql/HISTORY
/usr/share/doc/postgresql/KNOWN_BUGS
/usr/share/doc/postgresql/MISSING_FEATURES
/usr/share/doc/postgresql/README
/usr/share/doc/postgresql/README.rpm-dist
/usr/share/doc/postgresql/TODO
/usr/share/doc/postgresql/bug.template
/usr/share/locale/cs/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/cs/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/cs/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/cs/LC_MESSAGES/psql-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/de/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/de/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/de/LC_MESSAGES/psql-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/es/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/es/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/es/LC_MESSAGES/psql-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/fr/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/fr/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/fr/LC_MESSAGES/psql-10.mo
/usr/share/locale/he/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/he/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/he/LC_MESSAGES/psql-10.mo
/usr/share/locale/it/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/it/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/it/LC_MESSAGES/psql-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/ja/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/ja/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/ja/LC_MESSAGES/psql-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/ko/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/ko/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/ko/LC_MESSAGES/psql-10.mo
/usr/share/locale/pl/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/pl/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/pl/LC_MESSAGES/psql-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/pt_BR/LC_MESSAGES/psql-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/ru/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/ru/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/ru/LC_MESSAGES/psql-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/sv/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/sv/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/sv/LC_MESSAGES/psql-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/tr/LC_MESSAGES/pg_upgrade-10.mo
/usr/share/locale/tr/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/tr/LC_MESSAGES/psql-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_dump-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pgscripts-10.mo
/usr/share/locale/zh_CN/LC_MESSAGES/psql-10.mo
/usr/share/man/man1/clusterdb.1.gz
/usr/share/man/man1/createdb.1.gz
/usr/share/man/man1/createuser.1.gz
/usr/share/man/man1/dropdb.1.gz
/usr/share/man/man1/dropuser.1.gz
/usr/share/man/man1/pg_dump.1.gz
/usr/share/man/man1/pg_dumpall.1.gz
/usr/share/man/man1/pg_isready.1.gz
/usr/share/man/man1/pg_restore.1.gz
/usr/share/man/man1/pg_upgrade.1.gz
/usr/share/man/man1/psql.1.gz
/usr/share/man/man1/reindexdb.1.gz
/usr/share/man/man1/vacuumdb.1.gz
/usr/share/man/man7/ABORT.7.gz
/usr/share/man/man7/ALTER_AGGREGATE.7.gz
/usr/share/man/man7/ALTER_COLLATION.7.gz
/usr/share/man/man7/ALTER_CONVERSION.7.gz
/usr/share/man/man7/ALTER_DATABASE.7.gz
/usr/share/man/man7/ALTER_DEFAULT_PRIVILEGES.7.gz
/usr/share/man/man7/ALTER_DOMAIN.7.gz
/usr/share/man/man7/ALTER_EVENT_TRIGGER.7.gz
/usr/share/man/man7/ALTER_EXTENSION.7.gz
/usr/share/man/man7/ALTER_FOREIGN_DATA_WRAPPER.7.gz
/usr/share/man/man7/ALTER_FOREIGN_TABLE.7.gz
/usr/share/man/man7/ALTER_FUNCTION.7.gz
/usr/share/man/man7/ALTER_GROUP.7.gz
/usr/share/man/man7/ALTER_INDEX.7.gz
/usr/share/man/man7/ALTER_LANGUAGE.7.gz
/usr/share/man/man7/ALTER_LARGE_OBJECT.7.gz
/usr/share/man/man7/ALTER_MATERIALIZED_VIEW.7.gz
/usr/share/man/man7/ALTER_OPERATOR.7.gz
/usr/share/man/man7/ALTER_OPERATOR_CLASS.7.gz
/usr/share/man/man7/ALTER_OPERATOR_FAMILY.7.gz
/usr/share/man/man7/ALTER_POLICY.7.gz
/usr/share/man/man7/ALTER_PUBLICATION.7.gz
/usr/share/man/man7/ALTER_ROLE.7.gz
/usr/share/man/man7/ALTER_RULE.7.gz
/usr/share/man/man7/ALTER_SCHEMA.7.gz
/usr/share/man/man7/ALTER_SEQUENCE.7.gz
/usr/share/man/man7/ALTER_SERVER.7.gz
/usr/share/man/man7/ALTER_STATISTICS.7.gz
/usr/share/man/man7/ALTER_SUBSCRIPTION.7.gz
/usr/share/man/man7/ALTER_SYSTEM.7.gz
/usr/share/man/man7/ALTER_TABLE.7.gz
/usr/share/man/man7/ALTER_TABLESPACE.7.gz
/usr/share/man/man7/ALTER_TEXT_SEARCH_CONFIGURATION.7.gz
/usr/share/man/man7/ALTER_TEXT_SEARCH_DICTIONARY.7.gz
/usr/share/man/man7/ALTER_TEXT_SEARCH_PARSER.7.gz
/usr/share/man/man7/ALTER_TEXT_SEARCH_TEMPLATE.7.gz
/usr/share/man/man7/ALTER_TRIGGER.7.gz
/usr/share/man/man7/ALTER_TYPE.7.gz
/usr/share/man/man7/ALTER_USER.7.gz
/usr/share/man/man7/ALTER_USER_MAPPING.7.gz
/usr/share/man/man7/ALTER_VIEW.7.gz
/usr/share/man/man7/ANALYZE.7.gz
/usr/share/man/man7/BEGIN.7.gz
/usr/share/man/man7/CHECKPOINT.7.gz
/usr/share/man/man7/CLOSE.7.gz
/usr/share/man/man7/CLUSTER.7.gz
/usr/share/man/man7/COMMENT.7.gz
/usr/share/man/man7/COMMIT.7.gz
/usr/share/man/man7/COMMIT_PREPARED.7.gz
/usr/share/man/man7/COPY.7.gz
/usr/share/man/man7/CREATE_ACCESS_METHOD.7.gz
/usr/share/man/man7/CREATE_AGGREGATE.7.gz
/usr/share/man/man7/CREATE_CAST.7.gz
/usr/share/man/man7/CREATE_COLLATION.7.gz
/usr/share/man/man7/CREATE_CONVERSION.7.gz
/usr/share/man/man7/CREATE_DATABASE.7.gz
/usr/share/man/man7/CREATE_DOMAIN.7.gz
/usr/share/man/man7/CREATE_EVENT_TRIGGER.7.gz
/usr/share/man/man7/CREATE_EXTENSION.7.gz
/usr/share/man/man7/CREATE_FOREIGN_DATA_WRAPPER.7.gz
/usr/share/man/man7/CREATE_FOREIGN_TABLE.7.gz
/usr/share/man/man7/CREATE_FUNCTION.7.gz
/usr/share/man/man7/CREATE_GROUP.7.gz
/usr/share/man/man7/CREATE_INDEX.7.gz
/usr/share/man/man7/CREATE_LANGUAGE.7.gz
/usr/share/man/man7/CREATE_MATERIALIZED_VIEW.7.gz
/usr/share/man/man7/CREATE_OPERATOR.7.gz
/usr/share/man/man7/CREATE_OPERATOR_CLASS.7.gz
/usr/share/man/man7/CREATE_OPERATOR_FAMILY.7.gz
/usr/share/man/man7/CREATE_POLICY.7.gz
/usr/share/man/man7/CREATE_PUBLICATION.7.gz
/usr/share/man/man7/CREATE_ROLE.7.gz
/usr/share/man/man7/CREATE_RULE.7.gz
/usr/share/man/man7/CREATE_SCHEMA.7.gz
/usr/share/man/man7/CREATE_SEQUENCE.7.gz
/usr/share/man/man7/CREATE_SERVER.7.gz
/usr/share/man/man7/CREATE_STATISTICS.7.gz
/usr/share/man/man7/CREATE_SUBSCRIPTION.7.gz
/usr/share/man/man7/CREATE_TABLE.7.gz
/usr/share/man/man7/CREATE_TABLESPACE.7.gz
/usr/share/man/man7/CREATE_TABLE_AS.7.gz
/usr/share/man/man7/CREATE_TEXT_SEARCH_CONFIGURATION.7.gz
/usr/share/man/man7/CREATE_TEXT_SEARCH_DICTIONARY.7.gz
/usr/share/man/man7/CREATE_TEXT_SEARCH_PARSER.7.gz
/usr/share/man/man7/CREATE_TEXT_SEARCH_TEMPLATE.7.gz
/usr/share/man/man7/CREATE_TRANSFORM.7.gz
/usr/share/man/man7/CREATE_TRIGGER.7.gz
/usr/share/man/man7/CREATE_TYPE.7.gz
/usr/share/man/man7/CREATE_USER.7.gz
/usr/share/man/man7/CREATE_USER_MAPPING.7.gz
/usr/share/man/man7/CREATE_VIEW.7.gz
/usr/share/man/man7/DEALLOCATE.7.gz
/usr/share/man/man7/DECLARE.7.gz
/usr/share/man/man7/DELETE.7.gz
/usr/share/man/man7/DISCARD.7.gz
/usr/share/man/man7/DO.7.gz
/usr/share/man/man7/DROP_ACCESS_METHOD.7.gz
/usr/share/man/man7/DROP_AGGREGATE.7.gz
/usr/share/man/man7/DROP_CAST.7.gz
/usr/share/man/man7/DROP_COLLATION.7.gz
/usr/share/man/man7/DROP_CONVERSION.7.gz
/usr/share/man/man7/DROP_DATABASE.7.gz
/usr/share/man/man7/DROP_DOMAIN.7.gz
/usr/share/man/man7/DROP_EVENT_TRIGGER.7.gz
/usr/share/man/man7/DROP_EXTENSION.7.gz
/usr/share/man/man7/DROP_FOREIGN_DATA_WRAPPER.7.gz
/usr/share/man/man7/DROP_FOREIGN_TABLE.7.gz
/usr/share/man/man7/DROP_FUNCTION.7.gz
/usr/share/man/man7/DROP_GROUP.7.gz
/usr/share/man/man7/DROP_INDEX.7.gz
/usr/share/man/man7/DROP_LANGUAGE.7.gz
/usr/share/man/man7/DROP_MATERIALIZED_VIEW.7.gz
/usr/share/man/man7/DROP_OPERATOR.7.gz
/usr/share/man/man7/DROP_OPERATOR_CLASS.7.gz
/usr/share/man/man7/DROP_OPERATOR_FAMILY.7.gz
/usr/share/man/man7/DROP_OWNED.7.gz
/usr/share/man/man7/DROP_POLICY.7.gz
/usr/share/man/man7/DROP_PUBLICATION.7.gz
/usr/share/man/man7/DROP_ROLE.7.gz
/usr/share/man/man7/DROP_RULE.7.gz
/usr/share/man/man7/DROP_SCHEMA.7.gz
/usr/share/man/man7/DROP_SEQUENCE.7.gz
/usr/share/man/man7/DROP_SERVER.7.gz
/usr/share/man/man7/DROP_STATISTICS.7.gz
/usr/share/man/man7/DROP_SUBSCRIPTION.7.gz
/usr/share/man/man7/DROP_TABLE.7.gz
/usr/share/man/man7/DROP_TABLESPACE.7.gz
/usr/share/man/man7/DROP_TEXT_SEARCH_CONFIGURATION.7.gz
/usr/share/man/man7/DROP_TEXT_SEARCH_DICTIONARY.7.gz
/usr/share/man/man7/DROP_TEXT_SEARCH_PARSER.7.gz
/usr/share/man/man7/DROP_TEXT_SEARCH_TEMPLATE.7.gz
/usr/share/man/man7/DROP_TRANSFORM.7.gz
/usr/share/man/man7/DROP_TRIGGER.7.gz
/usr/share/man/man7/DROP_TYPE.7.gz
/usr/share/man/man7/DROP_USER.7.gz
/usr/share/man/man7/DROP_USER_MAPPING.7.gz
/usr/share/man/man7/DROP_VIEW.7.gz
/usr/share/man/man7/END.7.gz
/usr/share/man/man7/EXECUTE.7.gz
/usr/share/man/man7/EXPLAIN.7.gz
/usr/share/man/man7/FETCH.7.gz
/usr/share/man/man7/GRANT.7.gz
/usr/share/man/man7/IMPORT_FOREIGN_SCHEMA.7.gz
/usr/share/man/man7/INSERT.7.gz
/usr/share/man/man7/LISTEN.7.gz
/usr/share/man/man7/LOAD.7.gz
/usr/share/man/man7/LOCK.7.gz
/usr/share/man/man7/MOVE.7.gz
/usr/share/man/man7/NOTIFY.7.gz
/usr/share/man/man7/PREPARE.7.gz
/usr/share/man/man7/PREPARE_TRANSACTION.7.gz
/usr/share/man/man7/REASSIGN_OWNED.7.gz
/usr/share/man/man7/REFRESH_MATERIALIZED_VIEW.7.gz
/usr/share/man/man7/REINDEX.7.gz
/usr/share/man/man7/RELEASE_SAVEPOINT.7.gz
/usr/share/man/man7/RESET.7.gz
/usr/share/man/man7/REVOKE.7.gz
/usr/share/man/man7/ROLLBACK.7.gz
/usr/share/man/man7/ROLLBACK_PREPARED.7.gz
/usr/share/man/man7/ROLLBACK_TO_SAVEPOINT.7.gz
/usr/share/man/man7/SAVEPOINT.7.gz
/usr/share/man/man7/SECURITY_LABEL.7.gz
/usr/share/man/man7/SELECT.7.gz
/usr/share/man/man7/SELECT_INTO.7.gz
/usr/share/man/man7/SET.7.gz
/usr/share/man/man7/SET_CONSTRAINTS.7.gz
/usr/share/man/man7/SET_ROLE.7.gz
/usr/share/man/man7/SET_SESSION_AUTHORIZATION.7.gz
/usr/share/man/man7/SET_TRANSACTION.7.gz
/usr/share/man/man7/SHOW.7.gz
/usr/share/man/man7/START_TRANSACTION.7.gz
/usr/share/man/man7/TABLE.7.gz
/usr/share/man/man7/TRUNCATE.7.gz
/usr/share/man/man7/UNLISTEN.7.gz
/usr/share/man/man7/UPDATE.7.gz
/usr/share/man/man7/VACUUM.7.gz
/usr/share/man/man7/VALUES.7.gz
/usr/share/man/man7/WITH.7.gz

References

Summary

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