
ショコラ
CentOS7 にポストグレスをインストールするには?
yumでキメマス。

もっさん先輩
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y epel-release centos-release-scl
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql14-server
手順
- CentOS7 のコンテナを起動します。
docker run --rm -it centos:7
- yum でポストグレスをインストールします。
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y epel-release centos-release-scl
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql14-server
- データベースを初期化します。
su -c '/usr/pgsql-14/bin/initdb -E UTF8 --locale=C' - postgres
- ポストグレスを開始します。
su -c '/usr/pgsql-14/bin/pg_ctl start' - postgres
- ポストグレスに入ってみましょう。
psql -U postgres
# psql -U postgres
psql (14.5)
Type "help" for help.
postgres=#
以上