Centos-7修改yum源(阿里yum源)

时间:2022-02-07 04:14:20

国外地址yum源下载慢,下到一半就断了,就这个原因就修改它为国内yum源地址

国内yum源:

阿里centos7 yum源:http://mirrors.aliyun.com/repo/Centos-7.repo

网易centos7 yum源:http://mirrors.163.com/.help/CentOS7-Base-163.repo

中科大centos7 yum源:https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3

以修改为阿里的yum源

1. 备份本地yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

2.获取阿里yum源配置文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.运行以下命令生成缓存 


yum clean all

yum makecache

OK。。。。。。