Centos8.x yum 源配置 解决 yum 不可用
2022/8/1 3:22:47
本文主要是介绍Centos8.x yum 源配置 解决 yum 不可用,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
备份
[root@iZ2ze1e3u7m7oe426pyndaa ~]# cd /etc/yum.repos.d/ [root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# ll total 48 -rw-r--r-- 1 root root 635 Nov 20 2020 CentOS-AppStream.repo -rw-r--r-- 1 root root 619 Nov 20 2020 CentOS-Base.repo -rw-r--r-- 1 root root 701 Nov 20 2020 CentOS-centosplus.repo -rw-r--r-- 1 root root 1329 Nov 20 2020 CentOS-CR.repo -rw-r--r-- 1 root root 668 Nov 20 2020 CentOS-Debuginfo.repo -rw-r--r-- 1 root root 227 Nov 20 2020 CentOS-epel.repo -rw-r--r-- 1 root root 663 Nov 20 2020 CentOS-Extras.repo -rw-r--r-- 1 root root 242 Nov 20 2020 CentOS-fasttrack.repo -rw-r--r-- 1 root root 928 Nov 20 2020 CentOS-Media.repo -rw-r--r-- 1 root root 639 Nov 20 2020 CentOS-PowerTools.repo -rw-r--r-- 1 root root 1382 Nov 20 2020 CentOS-Sources.repo -rw-r--r-- 1 root root 74 Nov 20 2020 CentOS-Vault.repo [[root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# mkdir /home/ydt/yum.repos.d.ori [root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# cp * /home/ydt/yum.repos.d.ori/ [root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# ll /home/ydt/yum.repos.d.ori/ total 48 -rw-r--r-- 1 root root 635 Feb 15 14:03 CentOS-AppStream.repo -rw-r--r-- 1 root root 619 Feb 15 14:03 CentOS-Base.repo -rw-r--r-- 1 root root 701 Feb 15 14:03 CentOS-centosplus.repo -rw-r--r-- 1 root root 1329 Feb 15 14:03 CentOS-CR.repo -rw-r--r-- 1 root root 668 Feb 15 14:03 CentOS-Debuginfo.repo -rw-r--r-- 1 root root 227 Feb 15 14:03 CentOS-epel.repo -rw-r--r-- 1 root root 663 Feb 15 14:03 CentOS-Extras.repo -rw-r--r-- 1 root root 242 Feb 15 14:03 CentOS-fasttrack.repo -rw-r--r-- 1 root root 928 Feb 15 14:03 CentOS-Media.repo -rw-r--r-- 1 root root 639 Feb 15 14:03 CentOS-PowerTools.repo -rw-r--r-- 1 root root 1382 Feb 15 14:03 CentOS-Sources.repo -rw-r--r-- 1 root root 74 Feb 15 14:03 CentOS-Vault.repo
清空yum源配置文件(注意目录地址)
[root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# rm -rf *
下载新的阿里云镜像源
[root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo --2022-02-15 14:04:11-- https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 39.96.118.189, 39.96.118.196, 39.96.118.148, ... Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|39.96.118.189|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2495 (2.4K) [application/octet-stream] Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’ /etc/yum.repos.d/CentOS-Base.repo 100%[================================================================================================================>] 2.44K --.-KB/s in 0s 2022-02-15 14:04:11 (63.2 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]
生成缓存
[root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# yum makecache CentOS-8.5.2111 - Base - mirrors.aliyun.com 25 MB/s | 4.6 MB 00:00 CentOS-8.5.2111 - Extras - mirrors.aliyun.com 296 kB/s | 10 kB 00:00 CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 46 MB/s | 8.4 MB 00:00 Metadata cache created. [root@iZ2ze1e3u7m7oe426pyndaa yum.repos.d]# ll total 4 -rw-r--r-- 1 root root 2495 Feb 14 21:16 CentOS-Base.repo
这篇关于Centos8.x yum 源配置 解决 yum 不可用的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 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款高效工具