【Centos】Centos系统换yum源

【Centos】Linux,Centos系统换yum源

1、备份

bash 复制代码
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

/etc/yum.repos.d/CentOS-Base.repo 是yum的配置文件

/etc/yum.repos.d/CentOS-Base.repo.bak 是我们备份的配置文件

2、下载yum源

这里用的是阿里的yum源,下载阿里云yum源,其他yum源就换其他链接

这里系统是Centos7,8的话就换成8

bash 复制代码
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

刚装的系统没有wget命令,手动访问链接,下载,复制一下,然后vi创建/etc/yum.repos.d/CentOS-Base.repo,粘贴进去。

3、配置生效

清理缓存

bash 复制代码
yum clean all

重建缓存

bash 复制代码
yum makecache

成功

相关推荐
Tipriest_3 分钟前
linux git ssh配置过程
linux·git·ssh
吃不胖没烦恼12 分钟前
Docker 初学者需要了解的几个知识点 (五):建容器需要进一步了解的概念
运维·docker·容器
运维小杨21 分钟前
linux运维学习第十三周
运维·学习
三不原则1 小时前
自动化与配置管理工具 ——Puppet
运维·自动化·puppet
dessler1 小时前
RabbitMQ-伪集群部署(Cluster)
linux·运维·rabbitmq
jzy37111 小时前
国产化适配鲲鹏arm环境:hive on tez 单节点部署实践总结
linux·hadoop·apache hive
阿巴~阿巴~1 小时前
Linux核心转储(Core Dump)原理、配置与调试实践
linux·运维·服务器
第四维度42 小时前
【Debian】4-‌2 Gitea搭建
运维·debian·gitea
程序员的世界你不懂2 小时前
Jmeter 命令行压测、HTML 报告、Jenkins 配置目录
运维·jmeter·jenkins
Sadsvit2 小时前
Linux 时钟同步配置:基础管理与 chrony 工具应用
linux·运维·chrome