首页 > 系统相关 >解决Centos8.x报Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:...

解决Centos8.x报Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:...

时间:2023-01-05 21:03:36浏览次数:47  
标签:... prepare repos repo download mirrorlist yum appstream metadata

今天新购买的服务器安装宝塔面板时出现ERROR: 出现下面错误“错误:Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist”.

 

 

 查询后发现问题的原因是Centos8于2021年年底停止了服务,我们在使用yum源安装时候,出现下面错误“错误:Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist”。

解决办法:

1. 进入yum的repos目录:  

cd /etc/yum.repos.d/

2. 修改所有的CentOS文件内容:

  分别输入已下2行命令:

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

3. 测试是否可以yum安装:

yum -y install gcc

如果再没有异常信息,则安装就成功了。

参考:https://www.tecmint.com/error-failed-to-download-metadata-for-repo-appstream/

 

 

 

标签:...,prepare,repos,repo,download,mirrorlist,yum,appstream,metadata
From: https://www.cnblogs.com/harbin1900/p/17028829.html

相关文章