CentOS 8 使用yum 安装软件失败
一些事项
用 yum 安装 git 失败
Failed to download metadata for repo 'appstream'
原因是 CentOS8 的源在2021年12月31日停止服务
所以替换了数据源
/etc/yum.repos.d/
同地址下备份为 /etc/yum.repos.d.backup
所以现在问题:
yum 安装 出错
Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
解决方法:
sed -i 's/$releasever/8-stream/' CentOS*repo
然后尝试 yum install git
引发了新的错误
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
解决方法:
修改 BaseOS.repo 文件的 baseurl 参数
[baseos]
baseurl=htps://vault.centos.org/centos/$releasever/BaseOS/$basearch/os/
修改 AppStream.repo 文件的 baseurl 参数
[appstream]
baseurl=htps://vault.centos.org/centos/$releasever/AppStream/$basearch/os/
重建缓存
yum clean all
rpm --rebuilddb
yum update
yum list
yum makecache
又双抛出了新的问题
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
使用 命令 如下修复
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-*
文章参考
https://www.pudn.com/news/625d998ebe9ad24cfa84a4fc.html
https://www.pudn.com/news/6281b70b9b6e2b6d55a79008.html
http://dljz.nicethemes.cn/news/show-189146.html
http://dljz.nicethemes.cn/news/show-404986.html
https://www.miqutech.cn/955.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类