Linux:Yum – error:[Errno 14] Peer cert cannot be verified or peer cert invalid 或 Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
报错如题所示,具体如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@TestSql1 ~]# yum makecache Loaded plugins: fastestmirror Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com base | 3.7 kB 00:00 base/group_gz | 242 kB 00:00 base/filelists_db | 6.4 MB 00:00 base/primary_db | 4.7 MB 00:00 base/other_db | 2.8 MB 00:00 https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again [root@TestSql1 ~]# |
其实,报错中提示的URL【https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/repodata/repomd.xml】是可以访问的:
造成YUM出现该问题的原因其实是时间不对。
看看当前系统的时间:
1 2 3 |
[root@TestSql1 ~]# date 2014年 07月 28日 星期一 11:53:01 CST [root@TestSql1 ~]# |
修改成当前时间:
1 2 3 4 5 6 |
[root@TestSql1 ~]# date -s "2019-04-15 14:22" 2019年 04月 15日 星期一 14:22:00 CST [root@TestSql1 ~]# [root@TestSql1 ~]# date 2019年 04月 15日 星期一 14:22:05 CST [root@TestSql1 ~]# |
再看看YUM的表现:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
[root@TestSql1 ~]# yum makecache Loaded plugins: fastestmirror Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Determining fastest mirrors * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com base | 3.7 kB 00:00 epel | 4.7 kB 00:00 epel/group_gz | 71 kB 00:00 epel/filelists_db | 7.9 MB 00:00 epel/updateinfo | 815 kB 00:00 epel/prestodelta | 2.4 kB 00:00 epel/primary_db | 6.0 MB 00:00 epel/other_db | 3.0 MB 00:00 extras | 3.4 kB 00:00 extras/filelists_db | 24 kB 00:00 extras/prestodelta | 2.2 kB 00:00 extras/primary_db | 29 kB 00:00 extras/other_db | 14 kB 00:00 updates | 3.4 kB 00:00 updates/filelists_db | 2.7 MB 00:00 updates/prestodelta | 138 kB 00:00 updates/primary_db | 3.7 MB 00:00 updates/other_db | 193 kB 00:00 Metadata Cache Created [root@TestSql1 ~]# |
可以看到,再次【makecache】就没问题了。
——————————————————————
Done。