签到成功

知道了

CNDBA社区CNDBA社区

Linux YUM Peer's Certificate has expired 错误解决方法

2022-12-05 21:15 2119 0 原创 Linux
作者: dave

1 问题现象

Linux 平台在线安装PG 软件,报如下错误:http://www.cndba.cn/cndba/dave/article/116373

[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源,因为时间不对导致安装报如下错误: http://www.cndba.cn/cndba/dave/article/116373

“Peer’s Certificate has expired.”http://www.cndba.cn/cndba/dave/article/116373

http://www.cndba.cn/cndba/dave/article/116373
http://www.cndba.cn/cndba/dave/article/116373

解决方法就是更新本地时间:

http://www.cndba.cn/cndba/dave/article/116373
http://www.cndba.cn/cndba/dave/article/116373http://www.cndba.cn/cndba/dave/article/116373

[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]#

时间同步后在安装就不再报错了:http://www.cndba.cn/cndba/dave/article/116373

http://www.cndba.cn/cndba/dave/article/116373

[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      
……

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2283
    原创
  • 3
    翻译
  • 579
    转载
  • 196
    评论
  • 访问:8175975次
  • 积分:4428
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ