1 问题现象
Linux 平台在线安装PG 软件,报如下错误:
[dave@www.cndba.cn yum.repos.d]# yum install -y postgresql14-server
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7Server-x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate has expired."
Trying other mirror.
It was impossible to connect to the Red Hat servers.
This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
or a transparent proxy that tampers with TLS security, or an incorrect system clock.
Please collect information about the specific failure that occurs in your environment,
using the instructions in: https://access.redhat.com/solutions/1527033 and open a ticket with Red Hat Support.
One of the configured repositories failed (PostgreSQL common RPMs for RHEL / CentOS 7Server - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=pgdg-common ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable pgdg-common
or
subscription-manager repos --disable=pgdg-common
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=pgdg-common.skip_if_unavailable=true
failure: repodata/repomd.xml from pgdg-common: [Errno 256] No more mirrors to try.
https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7Server-x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate has expired."
[dave@www.cndba.cn yum.repos.d]# date
Sat Sep 10 01:55:27 CST 2022
2 解决方法
本地yum源 安装是没有问题的,我们这里因为使用了公网的yum源,因为时间不对导致安装报如下错误:
“Peer’s Certificate has expired.”
解决方法就是更新本地时间:
[dave@www.cndba.cn yum.repos.d]# ntpdate cn.pool.ntp.org
5 Dec 21:04:32 ntpdate[2336]: step time server 84.16.73.33 offset 7499276.669371 sec
[dave@www.cndba.cn yum.repos.d]# date
Mon Dec 5 21:04:34 CST 2022
[dave@www.cndba.cn yum.repos.d]#
[dave@www.cndba.cn yum.repos.d]#
时间同步后在安装就不再报错了:
[dave@www.cndba.cn yum.repos.d]# yum install -y postgresql14-server
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
dave | 2.8 kB 00:00:00
pgdg-common/7Server/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-28.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg-common/7Server/x86_64/signature | 2.9 kB 00:00:00 !!!
pgdg10/7Server/x86_64/signature
……
版权声明:本文为博主原创文章,未经博主允许不得转载。