PostgreSQL バージョンをインストールできません。 RHEL7には11のクライアントがあります。

PostgreSQL バージョンをインストールできません。 RHEL7には11のクライアントがあります。

私のサーバーシステムは次のとおりです

$  lsb_release -d
Description:    Red Hat Enterprise Linux Server release 7.5 (Maipo)

通常、このサーバーにpostgres:11を実行しているDockerizedデータベースがあり、おおまかに言うと、ここでデータベースダンプを作成する必要があります。

次のように入力してください。

$ sudo yum install postgresql

バージョン9では、postgresql clinet(pg_dump、psqlなどを含む)をインストールできます。しかし、postgresql:11データベースからダンプを生成できなかったので、次の提案を見つけました。https://www.symmcom.com/docs/how-tos/databases/how-to-install-postgresql-11-x-on-centos-7

私はそれを段階的にしました:

step 1: $ sudo yum update -y  # I didn't sudo reboot as I wanted to avoid server to not start again and ghaving to ask IT support for restarting it for me

step 2: $ sudo rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

step 3: $ sudo yum install postgresql11 -y

奇妙なことは、これがインストールされ動作することが今回が初めてだということです。しかし、ログアウト/ログインした後も、postgresql:9最初の選択で元々プリインストールされたものがまだ残っていたので、すべてのpostgresqlを削除しました。yum remove postgresql postgresql11

上記の手順1〜3を再試行しましたが、次の結果が得られました。

$ sudo yum install postgresql11 -y
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos
This system is not registered with RHN Classic or Red Hat Satellite.
You can use rhn_register to register.
Red Hat Satellite or RHN Classic support will be disabled.
No package postgresql11 available.
Error: Nothing to do

postgresql11パッケージを再インストールしようとしたときに表示されない理由を説明してください。

yumキャッシュを削除してみましたが、役に立ちませんでした。

以下からログインyum list:

$ sudo yum list | grep postgresql
This system is not registered with RHN Classic or Red Hat Satellite.
You can use rhn_register to register.
Red Hat Satellite or RHN Classic support will be disabled.
postgresql.x86_64                    9.2.24-2.el7_7           @GSS-RHEL7
postgresql-devel.x86_64              9.2.24-2.el7_7           @GSS-RHEL7
postgresql-libs.x86_64               9.2.24-2.el7_7           @GSS-RHEL7
postgresql11-libs.x86_64             11.7-1PGDG.rhel7         @pgdg11
qt-postgresql.x86_64                 1:4.8.7-4.el7            @GSS-RHEL7
qt5-qtbase-postgresql.x86_64         5.9.7-2.el7              @GSS-RHEL7
freeradius-postgresql.x86_64         3.0.13-10.el7_6          GSS-RHEL7-optional
libreoffice-postgresql.x86_64        1:5.3.6.1-21.el7         GSS-RHEL7-optional
pcp-pmda-postgresql.x86_64           4.3.2-4.el7_7            GSS-RHEL7
postgresql.i686                      9.2.24-2.el7_7           GSS-RHEL7
postgresql-contrib.x86_64            9.2.24-2.el7_7           GSS-RHEL7
postgresql-devel.i686                9.2.24-2.el7_7           GSS-RHEL7
postgresql-docs.x86_64               9.2.24-2.el7_7           GSS-RHEL7
postgresql-jdbc.noarch               9.2.1002-6.el7_5         GSS-RHEL7
postgresql-jdbc-javadoc.noarch       9.2.1002-6.el7_5         GSS-RHEL7-optional
postgresql-libs.i686                 9.2.24-2.el7_7           GSS-RHEL7
postgresql-odbc.x86_64               09.03.0100-2.el7         GSS-RHEL7
postgresql-plperl.x86_64             9.2.24-2.el7_7           GSS-RHEL7
postgresql-plpython.x86_64           9.2.24-2.el7_7           GSS-RHEL7
postgresql-pltcl.x86_64              9.2.24-2.el7_7           GSS-RHEL7
postgresql-server.x86_64             9.2.24-2.el7_7           GSS-RHEL7
postgresql-static.i686               9.2.24-2.el7_7           GSS-RHEL7-optional
postgresql-static.x86_64             9.2.24-2.el7_7           GSS-RHEL7-optional
postgresql-test.x86_64               9.2.24-2.el7_7           GSS-RHEL7
postgresql-upgrade.x86_64            9.2.24-2.el7_7           GSS-RHEL7-optional
qt-postgresql.i686                   1:4.8.7-4.el7            GSS-RHEL7
qt5-qtbase-postgresql.i686           5.9.7-2.el7              GSS-RHEL7

ベストアンサー1

解決済み:

これが正しいアプローチであるかどうかはわかりませんが、役に立つ解決策で答えました。

RPMマネージャでpostgresql11を強制的に使用し、パッケージを再インストールしました。https://www.redhat.com/archives/rpm-list/2005-September/msg00030.html

通過:

$ rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs

その後、元々インストールされたpostgresqlのバージョンを削除しました。 9

$ yum remove postgresql

ついに:

$ sudo yum install postgresql11-server postgresql11 -y
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos
This system is not registered with RHN Classic or Red Hat Satellite.
You can use rhn_register to register.
Red Hat Satellite or RHN Classic support will be disabled.
Resolving Dependencies
--> Running transaction check
---> Package postgresql11.x86_64 0:11.7-1PGDG.rhel7 will be installed
---> Package postgresql11-server.x86_64 0:11.7-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================================
 Package                                                  Arch                                        Version                                                  Repository                                   Size
=================================================================================================================================================================================================================
Installing:
 postgresql11                                             x86_64                                      11.7-1PGDG.rhel7                                         pgdg11                                      1.7 M
 postgresql11-server                                      x86_64                                      11.7-1PGDG.rhel7                                         pgdg11                                      4.7 M

Transaction Summary
=================================================================================================================================================================================================================
Install  2 Packages

Total download size: 6.4 M
Installed size: 28 M
Downloading packages:
(1/2): postgresql11-11.7-1PGDG.rhel7.x86_64.rpm                                                                                                                                           | 1.7 MB  00:00:00
(2/2): postgresql11-server-11.7-1PGDG.rhel7.x86_64.rpm                                                                                                                                    | 4.7 MB  00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                            8.8 MB/s | 6.4 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : postgresql11-11.7-1PGDG.rhel7.x86_64                                                                                                                                                          1/2
  Installing : postgresql11-server-11.7-1PGDG.rhel7.x86_64                                                                                                                                                   2/2
  Verifying  : postgresql11-server-11.7-1PGDG.rhel7.x86_64                                                                                                                                                   1/2
  Verifying  : postgresql11-11.7-1PGDG.rhel7.x86_64                                                                                                                                                          2/2

Installed:
  postgresql11.x86_64 0:11.7-1PGDG.rhel7                                                              postgresql11-server.x86_64 0:11.7-1PGDG.rhel7

Complete!

それは私にとって効果的でした。おそらく、--replacepkgsrpmマネージャにオプションを追加すると、誰かに役立ちます。しかし、なぜそれが必要なのか分からない。

おすすめ記事