1

My system on server is:

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

Generally I have a Dockerized running postgres:11 database on this server and roughly speaking I need to create a database dump from it.

By typing:

$ sudo yum install postgresql

I can install postgresql clinet (that includes pg_dump, psql, etc) in version 9. But it can't create a dump from postgresql:11 database, so I found advice in: https://www.symmcom.com/docs/how-tos/databases/how-to-install-postgresql-11-x-on-centos-7

I did step-by-step:

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

What's weird - for the first time it installed and worked. However, after logout/login I still had originally preinstalled postgresql:9 as the first choice, so I removed all postgresql with yum remove postgresql postgresql11

I tried again to do execute above steps from 1-3 but I get:

$ 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

Can you help me why the package postgresql11 isn't seen when I try yo install it again?

I tried to clean up cache of yum but doesn't help.

Logs from 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
2
  • When you removed the Postgres 11 package, did it also remove the repository package? I can see you have the postgresql11-libs package, so it most likely worked the first time. Also, your system isn’t getting updates from Red Hat so it might not work since your OS is several years out of date. Commented May 9, 2020 at 1:37
  • I removed it and didn't helped. Only after doing rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs it helped. Commented May 11, 2020 at 9:52

1 Answer 1

1

SOLVED:

I am not sure if it is a correct way but I respond with solution with helped me:

From RPM manager I forced to reinstall package with postgresql11 https://www.redhat.com/archives/rpm-list/2005-September/msg00030.html

by:

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

Then I removed originally isntalled postgresql ver. 9

$ yum remove postgresql

And in the end:

$ 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!

It works for me, maybe adding option --replacepkgs to rpm manager will help somebody, but I'm not sure why it is even needed?

1
  • It sounds like you either deleted or disabled the "pgdg11" yum repo. For what its worth, you could also replace your rpm command with yum reinstall https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm. Commented May 11, 2020 at 15:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.