修改yum源

一。进入yum源目录

[root@VM_14_49_centos ~]# cd /etc/yum.repos.d/
[root@VM_14_49_centos yum.repos.d]# ls
CentOS-Base.repo  CentOS-Epel.repo
[root@VM_14_49_centos yum.repos.d]# 

二。备份yum源

[root@VM_14_49_centos yum.repos.d]# mv CentOS-Base.repo ./CentOS-Base.repo.bak
[root@VM_14_49_centos yum.repos.d]# ls
CentOS-Base.repo.bak  CentOS-Epel.repo
[root@VM_14_49_centos yum.repos.d]# 

三。下载yum源(阿里云的)

[root@VM_14_49_centos yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-6.repo
--2017-12-03 11:43:44--  http://mirrors.aliyun.com/repo/Centos-6.repo
Resolving mirrors.aliyun.com... 183.60.159.232, 183.60.159.225, 183.60.159.226, ...
Connecting to mirrors.aliyun.com|183.60.159.232|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2572 (2.5K) [application/octet-stream]
Saving to: “Centos-6.repo”

100%[===========================================================================================>] 2,572       --.-K/s   in 0s      

2017-12-03 11:43:44 (382 MB/s) - “Centos-6.repo” saved [2572/2572]

[root@VM_14_49_centos yum.repos.d]# ls
Centos-6.repo  CentOS-Base.repo.bak  CentOS-Epel.repo
[root@VM_14_49_centos yum.repos.d]# 

四。修改yum源为阿里云的

[root@VM_14_49_centos yum.repos.d]# mv Centos-6.repo ./CentOS-Base.repo
[root@VM_14_49_centos yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.bak  CentOS-Epel.repo
[root@VM_14_49_centos yum.repos.d]# yum makecache

五。完成

posted @ 2017-12-03 11:49  Python++  阅读(691)  评论(0编辑  收藏  举报