centos7 yum 更换源

1.首先进行备份

[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.进入yum源所在文件夹

[root@localhost ~]# cd /etc/yum.repos.d/

3.下载需要更新的yum源配置文件

[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4.生成缓存

[root@localhost ~]# yum makecache

5.更新yum

[root@localhost ~]# yum -y update

你可能感兴趣的:(linux)