CentOS7如何更换yum源

一、进入/etc/yum.repos.d/目录

cd /etc/yum.repos.d/

二、备份镜像文件

mv CentOS-Base.repo CentOS-Base.repo.backup


三、使用wget获取镜像源(阿里云)

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

四、常用的yum镜像源

阿里云 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 
网易163 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
 
华为云 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.myhuaweicloud.com/repo/CentOS-7.repo
 
华东理工大学 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64
 
清华大学 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/
 
中国科学技术大学 CentOS 7 源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.ustc.edu.cn/centos/7/os/x86_64/

你可能感兴趣的:(linux)