No URLs in mirrorlist
时间: 2023-10-07 20:11:15 浏览: 164
Copy All Urls-2.11.zip
回答: 当在CentOS 8中使用yum时出现"Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist"的错误时,这通常是由于镜像列表中没有URL引起的。为了解决这个问题,你可以执行以下两行代码来修改yum的配置文件:
sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
这些代码将注释掉原来的mirrorlist,并将baseurl修改为http://vault.centos.org。执行完这些代码后,你可以再次尝试使用yum命令,应该就能够成功下载metadata了。\[1\]\[2\]
#### 引用[.reference_title]
- *1* [CentOS 8: No URLs in mirrorlist error](https://blog.csdn.net/xiaocao_debug/article/details/122807870)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [CentOS 8 的 yum 安装组件出错 —— Cannot prepare internal mirrorlist: No URLs in mirrorlist](https://blog.csdn.net/Shockang/article/details/126335260)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Cannot prepare internal mirrorlist: No URLs in mirrorlist](https://blog.csdn.net/AlexanderRon/article/details/123400906)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文