無法安裝 postgresql 版本。RHEL7 上的 11 個客戶端
我在伺服器上的系統是:
$ lsb_release -d Description: Red Hat Enterprise Linux Server release 7.5 (Maipo)
一般來說,我在這台伺服器上有一個 Dockerized 執行的 postgres:11 數據庫,粗略地說,我需要從中創建一個數據庫轉儲。
通過鍵入:
$ sudo yum install postgresql
我可以在版本 9 中安裝 postgresql clinet(包括 pg_dump、psql 等)。但它不能從 postgresql:11 數據庫創建轉儲,所以我在以下位置找到了建議:https ://www.symmcom.com/docs/操作方法/數據庫/如何安裝-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
作為首選,所以我刪除了所有 postgresqlyum 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
解決了:
我不確定這是否是正確的方法,但我用幫助我的解決方案做出回應:
從 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!
它對我有用,也許向
--replacepkgs
rpm 管理器添加選項會有所幫助,但我不確定為什麼甚至需要它?