解决:Failed to download metadata for repo ‘base‘
2022/6/15 3:20:06
本文主要是介绍解决:Failed to download metadata for repo ‘base‘,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1.先查看本机的系统信息
[root@h0436 h0436 zlong]# cat /etc/redhat-release
2.进入yum.repos.d
[root@h0436 zlong]# cd /etc/yum.repos.d
3.查看镜像文件(看看你需要修改的哪个文件)
[root@h0436 yum.repos.d]# ls CentOS-Base.repo CentOS-Base.repo.bak epel.repo CentOS-Base.repo.backup docker-ce.repo
4.修改文件(我的是CentOS-Base.repo.backup文件)
[root@h0436 yum.repos.d]# vim CentOS-Base.repo.backup
5.如果你找不到在哪个文件夹,你就每个文件夹都vim 进去看看,找到CentOS-Base.repo就行
6.复制下面这一段配置就行,按键盘上“i”编辑,按ESC退出。如果要保存退出就按:wq,如果不保存退出就按:q (图中标红的地方都是改过之后的地方)
[base] name=CentOS-8 - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/8/os/$basearch/ http://mirrors.aliyuncs.com/centos/8/os/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/8/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8 #released updates [updates] name=CentOS-8 - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/8/updates/$basearch/ http://mirrors.aliyuncs.com/centos/8/updates/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/8/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8 #additional packages that may be useful [extras] name=CentOS-8 - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/8/extras/$basearch/ http://mirrors.aliyuncs.com/centos/8/extras/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/8/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-8 - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/8/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos/8/centosplus/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/8/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8 #contrib - packages by Centos Users [contrib] name=CentOS-8 - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/8/contrib/$basearch/ http://mirrors.aliyuncs.com/centos/8/contrib/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/8/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
7.清除缓存
[root@h0436 yum.repos.d]# yum clean all
8.加载缓存
[root@h0436 yum.repos.d]# yum makecache
这篇关于解决:Failed to download metadata for repo ‘base‘的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-22初创企业的效率秘诀!实用的看板式任务管理工具推荐
- 2024-12-22新能源汽车销售难题如何破?看板工具助力门店管理升级
- 2024-12-218 款现代无代码工具,轻松提升开发者工作效率 ???????
- 2024-12-21从线索跟踪到业绩提升:销售任务管理系统推荐
- 2024-12-21刚刚发布RobinReach:多渠道社交媒体管理工具 ??
- 2024-12-21跨地域协作无压力!推荐几款必备的可视化协同工具
- 2024-12-21初学者指南:轻松掌握文章编辑器
- 2024-12-21Excel数据导出教程:让数据迁移变得简单
- 2024-12-21Excel数据导入入门教程
- 2024-12-215分钟速览:优化项目管理必备的5款高效工具