linux为repo 'AppStream'下载元数据失败的解决
查看网络有无连接,或者防火墙。
Centos8下载元数据失败(Cannot download repomd.xml: Cannot download repodata/repomd.xml)背景新装了Centos8操作系统,安装yum-utils时报错。
[parallels@localhost yum.repos.d]$ sudo yum install -y yum-utils CentOS Linux 8 - AppStream0.0 B/s | 0 B 00:00 Errors during downloading metadata for repository 'appstream': - Curl error (6): Couldn't resolve host name for http://mirror.cloud.aliyuncs.com/centos-vault/8.5.2111/AppStream/x86_64/os/repodata/repomd.xml [Could not resolve host: mirror.cloud.aliyuncs.com]错误:为仓库 'appstream' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
问题分析经查询,CentOS8操作系统版本生命周期结束,Linux社区不再维护,需要还源。
解决办法将yum源换为国内流行的阿里云
1)备份
cd /etc/repos.d/sudo rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo2)从阿里云下载从阿里云下载
sudo wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.reposudo wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo3)替换源链接
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/epel-archive-8.repo4)清除并更新缓存
yum clean all && yum makecache5)验证
sudo yum update总结以上为个人经验,希望能给大家一个参考,也希望大家多多支持好吧啦网。
![Linux命令行处理图片方式(图片格式转换、缩放、旋转等)](http://www.haobala.com/attached/image/news/202309/18124551e2.jpg)