centos8停止更新 切换yum源为阿里云

 
更多

问题描述
使用yum安装时出现如下错误:

Errors during downloading metadata for repository ‘AppStream’:
  – Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo ‘AppStream’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

问题分析
阿里云解释:centos8官方源已下线,建议切换centos-vault源

解决方法
1.删除AppStream源
rm -f /etc/yum.repos.d/CentOS-AppStream.repo
2.取消并备份旧yum源(可直接删除)
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3.下载vault源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
4.清除yum缓存
yum clean all
5.生成新缓存
 yum makecache
附加
如果出现 Couldn’t resolve host ‘mirrors.cloud.aliyuncs.com’ ,非阿里云服务器无法访问其内网域名,需要作替换,eg:

sed -i -e ‘/mirrors.cloud.aliyuncs.com/d’ -e ‘/mirrors.aliyuncs.com/d’ /etc/yum.repos.d/CentOS-Base.repo

打赏

本文固定链接: https://www.cxy163.net/archives/1860 | 绝缘体

该日志由 绝缘体.. 于 2022年05月13日 发表在 首页 分类下,
原创文章转载请注明: centos8停止更新 切换yum源为阿里云 | 绝缘体
【上一篇】
【下一篇】

报歉!评论已关闭.