postgresql yum在先安装
【摘要】 1,下载yum配置文件[root@hecs-66a2 yum.repos.d]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmLoaded plugins: fastestmirrorpgdg-redhat...
1,下载yum配置文件
[root@hecs-66a2 yum.repos.d]# yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Loaded plugins: fastestmirror
pgdg-redhat-repo-latest.noarch.rpm | 7.7 kB 00:00:00
Examining /var/tmp/yum-root-OAV0LU/pgdg-redhat-repo-latest.noarch.rpm: pgdg-redhat-repo-42.0-20.noarch
Marking /var/tmp/yum-root-OAV0LU/pgdg-redhat-repo-latest.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-20 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================
Installing:
pgdg-redhat-repo noarch 42.0-20 /pgdg-redhat-repo-latest.noarch 11 k
Transaction Summary
========================================================================================================================================
Install 1 Package
Total size: 11 k
Installed size: 11 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : pgdg-redhat-repo-42.0-20.noarch 1/1
Verifying : pgdg-redhat-repo-42.0-20.noarch 1/1
Installed:
pgdg-redhat-repo.noarch 0:42.0-20
####
生成的YUM配置文件信息
####
[root@hecs-66a2 yum.repos.d]# more pgdg-redhat-all.repo
#######################################################
# PGDG Red Hat Enterprise Linux / CentOS repositories #
#######################################################
# PGDG Red Hat Enterprise Linux / CentOS stable common repository for all PostgreSQL versions
[pgdg-common]
name=PostgreSQL common RPMs for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
# PGDG Red Hat Enterprise Linux / CentOS stable repositories:
[pgdg14]
name=PostgreSQL 14 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
[pgdg13]
name=PostgreSQL 13 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
[pgdg12]
name=PostgreSQL 12 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
[pgdg11]
name=PostgreSQL 11 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
[pgdg10]
name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
[pgdg96]
name=PostgreSQL 9.6 for RHEL/CentOS $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-$releasever-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
repo_gpgcheck = 1
2,按pg 13软件
[root@hecs-66a2 yum.repos.d]# yum install -y postgresql13-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package postgresql13-server.x86_64 0:13.5-1PGDG.rhel7 will be installed
--> Processing Dependency: postgresql13-libs(x86-64) = 13.5-1PGDG.rhel7 for package: postgresql13-server-13.5-1PGDG.rhel7.x86_64
--> Processing Dependency: postgresql13(x86-64) = 13.5-1PGDG.rhel7 for package: postgresql13-server-13.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql13-server-13.5-1PGDG.rhel7.x86_64
--> Running transaction check
---> Package postgresql13.x86_64 0:13.5-1PGDG.rhel7 will be installed
---> Package postgresql13-libs.x86_64 0:13.5-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================
Installing:
postgresql13-server x86_64 13.5-1PGDG.rhel7 pgdg13 5.4 M
Installing for dependencies:
postgresql13 x86_64 13.5-1PGDG.rhel7 pgdg13 1.4 M
postgresql13-libs x86_64 13.5-1PGDG.rhel7 pgdg13 381 k
Transaction Summary
========================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 7.2 M
Installed size: 31 M
Downloading packages:
(1/3): postgresql13-libs-13.5-1PGDG.rhel7.x86_64.rpm | 381 kB 00:00:46
(2/3): postgresql13-13.5-1PGDG.rhel7.x86_64.rpm | 1.4 MB 00:01:20
postgresql13-server-13.5-1PGDG FAILED ========- ] 3.6 B/s | 4.8 MB 190:22:25 ETA
https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-7-x86_64/postgresql13-server-13.5-1PGDG.rhel7.x86_64.rpm: [Errno 12] Timeout on https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-7-x86_64/postgresql13-server-13.5-1PGDG.rhel7.x86_64.rpm: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
(3/3): postgresql13-server-13.5-1PGDG.rhel7.x86_64.rpm | 5.4 MB 00:03:13
----------------------------------------------------------------------------------------------------------------------------------------
Total 9.7 kB/s | 7.2 MB 00:12:38
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : postgresql13-libs-13.5-1PGDG.rhel7.x86_64 1/3
Installing : postgresql13-13.5-1PGDG.rhel7.x86_64 2/3
Installing : postgresql13-server-13.5-1PGDG.rhel7.x86_64 3/3
Verifying : postgresql13-13.5-1PGDG.rhel7.x86_64 1/3
Verifying : postgresql13-server-13.5-1PGDG.rhel7.x86_64 2/3
Verifying : postgresql13-libs-13.5-1PGDG.rhel7.x86_64 3/3
Installed:
postgresql13-server.x86_64 0:13.5-1PGDG.rhel7
Dependency Installed:
postgresql13.x86_64 0:13.5-1PGDG.rhel7 postgresql13-libs.x86_64 0:13.5-1PGDG.rhel7
Complete!
#3 ,验证数据库软件版本
[root@hecs-66a2 yum.repos.d]# pg_config
BINDIR = /usr/local/postgresql/bin
DOCDIR = /usr/local/postgresql/share/doc
HTMLDIR = /usr/local/postgresql/share/doc
INCLUDEDIR = /usr/local/postgresql/include
PKGINCLUDEDIR = /usr/local/postgresql/include
INCLUDEDIR-SERVER = /usr/local/postgresql/include/server
LIBDIR = /usr/local/postgresql/lib
PKGLIBDIR = /usr/local/postgresql/lib
LOCALEDIR = /usr/local/postgresql/share/locale
MANDIR = /usr/local/postgresql/share/man
SHAREDIR = /usr/local/postgresql/share
SYSCONFDIR = /usr/local/postgresql/etc
PGXS = /usr/local/postgresql/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/usr/local/postgresql'
CC = gcc -std=gnu99
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/usr/local/postgresql/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lz -lreadline -lrt -ldl -lm
VERSION = PostgreSQL 13.4
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)