Centos7执行yum install *时出现“Peer‘s Certificate has expired.“

一、引言

        今天在安装OpenResty的时候,出现了"Peer's Certificate has expired."的问题,详细错误如下:

[root@kubernetes ~]# sudo mv openresty.repo /etc/yum.repos.d/
[root@kubernetes ~]# sudo yum check-update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: mirror.sjtu.edu.cn
https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate has expired."
Trying other mirror.
It was impossible to connect to the CentOS 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.
You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.



 One of the configured repositories failed (Official OpenResty Open Source Repository for CentOS),
 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=openresty ...

     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 openresty
        or
            subscription-manager repos --disable=openresty

     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=openresty.skip_if_unavailable=true

failure: repodata/repomd.xml from openresty: [Errno 256] No more mirrors to try.
https://openresty.org/package/centos/7/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate has expired."

二、问题分析

通过在网上查询资料,得知可能是系统时间的问题;于是就查询了一下当前系统的时间,果然是时间对不上的问题:

[root@kubernetes ~]# date
Wed Aug 18 06:06:36 CST 2021

三、问题解决

1、安装 ntpdate。

[root@kubernetes ~]# yum install -y ntp

2、同步系统时间。

[root@kubernetes ~]# ntpdate time.apple.com
21 Nov 10:23:51 ntpdate[83378]: step time server 17.253.114.253 offset 8223337.126582 sec

3、再次执行安装。

[root@kubernetes ~]# sudo yum check-update
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink                                                                                                                                                                                   | 7.8 kB  00:00:00     
 * epel: mirror.sjtu.edu.cn
base                                                                                                                                                                                                   | 3.6 kB  00:00:00     
extras                                                                                                                                                                                                 | 2.9 kB  00:00:00     
openresty                                                                                                                                                                                              | 2.9 kB  00:00:00     
updates                                                                                                                                                                                                | 2.9 kB  00:00:00     
openresty/7/x86_64/primary_db                                                                                                                                                                          |  49 kB  00:00:00     

bind-export-libs.x86_64                                                                                     32:9.11.4-26.P2.el7_9.7                                                                                    updates
bind-libs-lite.x86_64                                                                                       32:9.11.4-26.P2.el7_9.7                                                                                    updates
bind-license.noarch                                                                                         32:9.11.4-26.P2.el7_9.7                                                                                    updates
binutils.x86_64                                                                                             2.27-44.base.el7_9.1                                                                                       updates
ca-certificates.noarch                                                                                      2021.2.50-72.el7_9                                                                                         updates
epel-release.noarch                                                                                         7-14                                                                                                       epel   
glibc.i686                                                                                                  2.17-325.el7_9                                                                                             updates
glibc.x86_64                                                                                                2.17-325.el7_9                                                                                             updates
glibc-common.x86_64                                                                                         2.17-325.el7_9                                                                                             updates
grub2.x86_64                                                                                                1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-common.noarch                                                                                         1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-pc.x86_64                                                                                             1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-pc-modules.noarch                                                                                     1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-tools.x86_64                                                                                          1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-tools-extra.x86_64                                                                                    1:2.02-0.87.el7.centos.7                                                                                   updates
grub2-tools-minimal.x86_64                                                                                  1:2.02-0.87.el7.centos.7                                                                                   updates
kernel.x86_64                                                                                               3.10.0-1160.45.1.el7                                                                                       updates
kernel-tools.x86_64                                                                                         3.10.0-1160.45.1.el7                                                                                       updates
kernel-tools-libs.x86_64                                                                                    3.10.0-1160.45.1.el7                                                                                       updates
kpartx.x86_64                                                                                               0.4.9-135.el7_9                                                                                            updates
libxml2.x86_64                                                                                              2.9.1-6.el7_9.6                                                                                            updates
libxml2-python.x86_64                                                                                       2.9.1-6.el7_9.6                                                                                            updates
nspr.x86_64                                                                                                 4.32.0-1.el7_9                                                                                             updates
nss.x86_64                                                                                                  3.67.0-3.el7_9                                                                                             updates
nss-softokn.x86_64                                                                                          3.67.0-3.el7_9                                                                                             updates
nss-softokn-freebl.i686                                                                                     3.67.0-3.el7_9                                                                                             updates
nss-softokn-freebl.x86_64                                                                                   3.67.0-3.el7_9                                                                                             updates
nss-sysinit.x86_64                                                                                          3.67.0-3.el7_9                                                                                             updates
nss-tools.x86_64                                                                                            3.67.0-3.el7_9                                                                                             updates
nss-util.x86_64                                                                                             3.67.0-1.el7_9                                                                                             updates
openldap.x86_64                                                                                             2.4.44-24.el7_9                                                                                            updates
openssl.x86_64                                                                                              1:1.0.2k-22.el7_9                                                                                          updates
openssl-libs.x86_64                                                                                         1:1.0.2k-22.el7_9                                                                                          updates
pigz.x86_64                                                                                                 2.3.4-1.el7                                                                                                epel   
python-perf.x86_64                                                                                          3.10.0-1160.45.1.el7                                                                                       updates
rpm.x86_64                                                                                                  4.11.3-46.el7_9                                                                                            updates
rpm-build-libs.x86_64                                                                                       4.11.3-46.el7_9                                                                                            updates
rpm-libs.x86_64                                                                                             4.11.3-46.el7_9                                                                                            updates
rpm-python.x86_64                                                                                           4.11.3-46.el7_9                                                                                            updates
sudo.x86_64                                                                                                 1.8.23-10.el7_9.2                                                                                          updates
tzdata.noarch                                                                                               2021e-1.el7                                                                                                updates
virt-what.x86_64                                                                                            1.18-4.el7_9.1                                                                                             updates
[root@kubernetes ~]# 

问题解决。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值