【无标题】centos 配置阿里云的yum源

1、查看系统正在使用的yum源列表
yum repolist

结果分析:目前这里看出有base ,extras ,updates三个yum源,这三个也是系统默认的yum源,一般还需要一个epel企业级额外的yum源,本文主要就是更改yum源的配置文件,把这几个yum源的baseurl改成aliyun镜像的,配置文件的路径在这/etc/yum.repos.d,

步骤,1、备份 CentOS-Base.repo (涉及系统默认的三个源)epel.repo 和 epel-testing.repo (涉及epel源,初次使用没有这个文件)

2、从阿里云上下载源的配置文件覆盖原来的文件
操作命令:
(如果没有wget 可以先用yum安装wget)
1.
//备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
//下载覆盖
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
2、
//备份
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
//下载覆盖
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
然后清空缓存
新建缓存就好了
yum clean all
yum makecache

相关推荐
Ching·19 小时前
linux系统编程(十②)RK3568 socket之 TCP 客户端的实现
linux·tcp/ip·rk3568
NiKo_W19 小时前
Linux 线程控制
linux·数据结构·内核·线程·进程·线程控制
迎風吹頭髮19 小时前
Linux内核架构浅谈44-Linux slab分配器:通用缓存与专用缓存的创建与使用
linux·spring·架构
---学无止境---19 小时前
Linux性能分析系统和虚拟文件系统缓存初始化
linux
小王C语言19 小时前
封装红黑树实现mymap和myset
linux·服务器·算法
獭.獭.19 小时前
Linux -- 线程概念
linux·线程·进程·多级页表·缺页异常
望获linux19 小时前
【实时Linux实战系列】使用 u-trace 或 a-trace 进行用户态应用剖析
java·linux·前端·网络·数据库·elasticsearch·操作系统
dessler19 小时前
Elasticsearch(ES)-Logstash
linux·运维·elasticsearch
lht63193561220 小时前
Ubuntu Server系统安装谷歌浏览器
linux·运维·ubuntu
JanelSirry20 小时前
DevOps是什么,有什么作用,一般用来干嘛
linux·运维·devops