How To Install postgresql-server.x86_64 on Amazon Linux 2

In this tutorial we learn how to install postgresql-server.x86_64 in Amazon Linux 2. postgresql-server.x86_64 is The programs needed to create and run a PostgreSQL server

Introduction

In this tutorial we learn how to install postgresql-server.x86_64 on Amazon Linux 2.

What is postgresql-server.x86_64

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 to install postgresql-server.x86_64 on Amazon Linux 2. In this tutorial we discuss both methods but you only need to choose one of method to install postgresql-server.x86_64.

Install postgresql-server.x86_64 on Amazon Linux 2 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install postgresql-server.x86_64

How To Uninstall postgresql-server.x86_64 on Amazon Linux 2

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

sudo yum remove postgresql-server.x86_64

postgresql-server.x86_64 Package Contents on Amazon Linux 2

/etc/pam.d/postgresql
/usr/bin/initdb
/usr/bin/pg_basebackup
/usr/bin/pg_controldata
/usr/bin/pg_ctl
/usr/bin/pg_receivexlog
/usr/bin/pg_resetxlog
/usr/bin/postgres
/usr/bin/postgresql-check-db-dir
/usr/bin/postgresql-setup
/usr/bin/postmaster
/usr/lib/systemd/system/postgresql.service
/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/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/share/locale/cs/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/cs/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/cs/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/cs/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/cs/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/cs/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/de/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/de/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/de/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/de/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/de/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/de/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/de/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/es/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/es/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/es/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/es/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/es/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/es/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/es/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/it/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/it/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/it/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/it/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/it/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/it/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/it/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/ko/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ko/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/ro/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ro/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/ro/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/ro/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/sv/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/sv/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/tr/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/tr/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/tr/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_basebackup-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/postgres-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_controldata-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_ctl-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_resetxlog-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/plpgsql-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/postgres-9.2.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_receivexlog.1.gz
/usr/share/man/man1/pg_resetxlog.1.gz
/usr/share/man/man1/postgres.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/pg_service.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/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
/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.x86_64 on Amazon Linux 2 using yum.