问题处理:CentOS Linux 8 – AppStream 错误:为仓库 ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs

问题呈现:
CentOS 8 上安装软件时,遇到如下报错:
CentOS Linux 8 – AppStream 错误:为仓库 ‘appstream’ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

问题原因:
CentOS Linux 8 在 2022 年 12 月 31 日来到生命周期终点(End of Life,EoL)。即 CentOS Linux 8 操作系统版本结束了生命周期(EOL),Linux 社区已不再维护该操作系统版本。所以原来的 CentOS Linux 8 的 yum 源也都失效了!最终导致此问题的产生。

解决方法:
更换 CentOS Linux 8 的 yum 源

[root@chemcentos ~]# yum module list nodejs
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository epel is listed more than once in the configuration
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/nodesource-el8.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/nodesource-el8.repo; 配置:ID 为 "failovermethod" 的 OptionBinding 不存在
CentOS Linux 8 - AppStream 69 B/s | 38 B 00:00
错误:为仓库 'appstream' 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist

[root@chemcentos yum.repos.d]# rm -rf *
[root@chemcentos yum.repos.d]# ls
[root@chemcentos yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-08-12 06:28:00--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 218.98.31.237, 218.98.31.243, 218.98.31.239, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|218.98.31.237|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2495 (2.4K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

/etc/yum.repos.d/CentOS-Base.repo                           100%[========================================================================================================================================>]   2.44K  --.-KB/s  用时 0s

2022-08-12 06:28:00 (51.1 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2495/2495])

[root@chemcentos yum.repos.d]# ls
CentOS-Base.repo
[root@chemcentos yum.repos.d]# vim CentOS-Base.repo
[root@chemcentos yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                                                                                                                   53 kB/s | 3.9 kB     00:00
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                                                                                                                 14 kB/s | 1.5 kB     00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                                                                                                                              68 kB/s | 4.3 kB     00:00
元数据缓存已建立。

 

 

 

 

© 版权声明

☆ END ☆
喜欢就点个赞吧
点赞0 分享
图片正在生成中,请稍后...