centos更換阿里yum源和epel

centos6.XX更換阿里雲的源

1,安裝wget:yum install -y wget

2,備份原來的yum源: mv  /etc/yum.repos.d /etc/yum.repos.d_bk

1、刪除現有的源:rm -rf /etc/yum.repos.d/*  
2、下載阿里yum源文件:wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo http://mirrors.aliyun.com/repo/Centos-6.repo

3,清理緩存:yum clean all

這個時候,執行 yum repolist的結果如下
[root@di02 ~]# yum repolist
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
--------------------- 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章